File tree 2 files changed +4
-4
lines changed
packages/compiler-sfc/src/script
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -175,14 +175,14 @@ export function resolveParserPlugins(
175
175
) {
176
176
plugins . push ( 'importAttributes' )
177
177
}
178
- if ( lang === 'jsx' || lang === 'tsx' ) {
178
+ if ( lang === 'jsx' || lang === 'tsx' || lang === 'mtsx' ) {
179
179
plugins . push ( 'jsx' )
180
180
} else if ( userPlugins ) {
181
181
// If don't match the case of adding jsx
182
182
// should remove the jsx from user options
183
183
userPlugins = userPlugins . filter ( p => p !== 'jsx' )
184
184
}
185
- if ( lang === 'ts' || lang === 'tsx' ) {
185
+ if ( lang === 'ts' || lang === 'mts' || lang === ' tsx' || lang === 'mtsx ') {
186
186
plugins . push ( [ 'typescript' , { dts } ] , 'explicitResourceManagement' )
187
187
if ( ! userPlugins || ! userPlugins . includes ( 'decorators' ) ) {
188
188
plugins . push ( 'decorators-legacy' )
Original file line number Diff line number Diff line change @@ -1139,12 +1139,12 @@ function parseFile(
1139
1139
parserPlugins ?: SFCScriptCompileOptions [ 'babelParserPlugins' ] ,
1140
1140
) : Statement [ ] {
1141
1141
const ext = extname ( filename )
1142
- if ( ext === '.ts' || ext === '.tsx' ) {
1142
+ if ( ext === '.ts' || ext === '.mts' || ext === '. tsx' || ext === '.mtsx ') {
1143
1143
return babelParse ( content , {
1144
1144
plugins : resolveParserPlugins (
1145
1145
ext . slice ( 1 ) ,
1146
1146
parserPlugins ,
1147
- filename . endsWith ( '.d.ts' ) ,
1147
+ / \. d \. m ? t s $ / . test ( filename ) ,
1148
1148
) ,
1149
1149
sourceType : 'module' ,
1150
1150
} ) . program . body
You can’t perform that action at this time.
0 commit comments