+7
-3
lines changedFilter options
+7
-3
lines changed Original file line number Diff line number Diff line change
@@ -101,7 +101,11 @@ export function compileScript(
101
101
sfc.template && sfc.template.attrs['inherit-attrs'] === 'false'
102
102
const scriptLang = script && script.lang
103
103
const scriptSetupLang = scriptSetup && scriptSetup.lang
104
-
const isTS = scriptLang === 'ts' || scriptSetupLang === 'ts'
104
+
const isTS =
105
+
scriptLang === 'ts' ||
106
+
scriptLang === 'tsx' ||
107
+
scriptSetupLang === 'ts' ||
108
+
scriptSetupLang === 'tsx'
105
109
const plugins: ParserPlugin[] = [...babelParserDefaultPlugins, 'jsx']
106
110
if (options.babelParserPlugins) plugins.push(...options.babelParserPlugins)
107
111
if (isTS) plugins.push('typescript', 'decorators-legacy')
@@ -110,7 +114,7 @@ export function compileScript(
110
114
if (!script) {
111
115
throw new Error(`[@vue/compiler-sfc] SFC contains no <script> tags.`)
112
116
}
113
-
if (scriptLang && scriptLang !== 'ts') {
117
+
if (scriptLang && !isTS && scriptLang !== 'jsx') {
114
118
// do not process non js/ts script blocks
115
119
return script
116
120
}
@@ -156,7 +160,7 @@ export function compileScript(
156
160
)
157
161
}
158
162
159
-
if (scriptSetupLang && scriptSetupLang !== 'ts') {
163
+
if (scriptSetupLang && !isTS && scriptSetupLang !== 'jsx') {
160
164
// do not process non js/ts script blocks
161
165
return scriptSetup
162
166
}
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4