File tree 1 file changed +7
-2
lines changed
packages/compiler-sfc/src
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,11 @@ export function compileScript(
170
170
const cssVars = sfc . cssVars
171
171
const scriptLang = script && script . lang
172
172
const scriptSetupLang = scriptSetup && scriptSetup . lang
173
+ const isJS =
174
+ scriptLang === 'js' ||
175
+ scriptLang === 'jsx' ||
176
+ scriptSetupLang === 'js' ||
177
+ scriptSetupLang === 'jsx'
173
178
const isTS =
174
179
scriptLang === 'ts' ||
175
180
scriptLang === 'tsx' ||
@@ -199,7 +204,7 @@ export function compileScript(
199
204
if ( ! script ) {
200
205
throw new Error ( `[@vue/compiler-sfc] SFC contains no <script> tags.` )
201
206
}
202
- if ( scriptLang && ! isTS && scriptLang !== 'jsx' ) {
207
+ if ( scriptLang && ! isJS && ! isTS ) {
203
208
// do not process non js/ts script blocks
204
209
return script
205
210
}
@@ -265,7 +270,7 @@ export function compileScript(
265
270
)
266
271
}
267
272
268
- if ( scriptSetupLang && ! isTS && scriptSetupLang !== 'jsx' ) {
273
+ if ( scriptSetupLang && ! isJS && ! isTS ) {
269
274
// do not process non js/ts script blocks
270
275
return scriptSetup
271
276
}
You can’t perform that action at this time.
0 commit comments