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 @@ -176,6 +176,11 @@ export function compileScript(
176
176
const cssVars = sfc . cssVars
177
177
const scriptLang = script && script . lang
178
178
const scriptSetupLang = scriptSetup && scriptSetup . lang
179
+ const isJS =
180
+ scriptLang === 'js' ||
181
+ scriptLang === 'jsx' ||
182
+ scriptSetupLang === 'js' ||
183
+ scriptSetupLang === 'jsx'
179
184
const isTS =
180
185
scriptLang === 'ts' ||
181
186
scriptLang === 'tsx' ||
@@ -205,7 +210,7 @@ export function compileScript(
205
210
if ( ! script ) {
206
211
throw new Error ( `[@vue/compiler-sfc] SFC contains no <script> tags.` )
207
212
}
208
- if ( scriptLang && ! isTS && scriptLang !== 'jsx' ) {
213
+ if ( scriptLang && ! isJS && ! isTS ) {
209
214
// do not process non js/ts script blocks
210
215
return script
211
216
}
@@ -271,7 +276,7 @@ export function compileScript(
271
276
)
272
277
}
273
278
274
- if ( scriptSetupLang && ! isTS && scriptSetupLang !== 'jsx' ) {
279
+ if ( scriptSetupLang && ! isJS && ! isTS ) {
275
280
// do not process non js/ts script blocks
276
281
return scriptSetup
277
282
}
You can’t perform that action at this time.
0 commit comments