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 @@ -166,6 +166,11 @@ export function compileScript(
166
166
const cssVars = sfc . cssVars
167
167
const scriptLang = script && script . lang
168
168
const scriptSetupLang = scriptSetup && scriptSetup . lang
169
+ const isJS =
170
+ scriptLang === 'js' ||
171
+ scriptLang === 'jsx' ||
172
+ scriptSetupLang === 'js' ||
173
+ scriptSetupLang === 'jsx'
169
174
const isTS =
170
175
scriptLang === 'ts' ||
171
176
scriptLang === 'tsx' ||
@@ -195,7 +200,7 @@ export function compileScript(
195
200
if ( ! script ) {
196
201
throw new Error ( `[@vue/compiler-sfc] SFC contains no <script> tags.` )
197
202
}
198
- if ( scriptLang && ! isTS && scriptLang !== 'jsx' ) {
203
+ if ( scriptLang && ! isJS && ! isTS ) {
199
204
// do not process non js/ts script blocks
200
205
return script
201
206
}
@@ -263,7 +268,7 @@ export function compileScript(
263
268
)
264
269
}
265
270
266
- if ( scriptSetupLang && ! isTS && scriptSetupLang !== 'jsx' ) {
271
+ if ( scriptSetupLang && ! isJS && ! isTS ) {
267
272
// do not process non js/ts script blocks
268
273
return scriptSetup
269
274
}
You can’t perform that action at this time.
0 commit comments