Skip to content

Commit d9eb6b9

Browse files
authored
perf(plugin-vue-jsx): hoist variables (#9687)
1 parent dfdbc59 commit d9eb6b9

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

packages/plugin-vue-jsx/src/index.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ function vueJsxPlugin(options: Options = {}): Plugin {
3838
let needHmr = false
3939
let needSourceMap = true
4040

41+
const { include, exclude, babelPlugins = [], ...babelPluginOptions } = options
42+
const filter = createFilter(include || /\.[jt]sx$/, exclude)
43+
4144
return {
4245
name: 'vite:vue-jsx',
4346

@@ -75,14 +78,6 @@ function vueJsxPlugin(options: Options = {}): Plugin {
7578

7679
async transform(code, id, opt) {
7780
const ssr = opt?.ssr === true
78-
const {
79-
include,
80-
exclude,
81-
babelPlugins = [],
82-
...babelPluginOptions
83-
} = options
84-
85-
const filter = createFilter(include || /\.[jt]sx$/, exclude)
8681
const [filepath] = id.split('?')
8782

8883
// use id for script blocks in Vue SFCs (e.g. `App.vue?vue&type=script&lang.jsx`)

0 commit comments

Comments
 (0)