This repository was archived by the owner on Jul 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/compiler-sfc/src/script Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -175,14 +175,14 @@ export function resolveParserPlugins(
175175 ) {
176176 plugins . push ( 'importAttributes' )
177177 }
178- if ( lang === 'jsx' || lang === 'tsx' ) {
178+ if ( lang === 'jsx' || lang === 'tsx' || lang === 'mtsx' ) {
179179 plugins . push ( 'jsx' )
180180 } else if ( userPlugins ) {
181181 // If don't match the case of adding jsx
182182 // should remove the jsx from user options
183183 userPlugins = userPlugins . filter ( p => p !== 'jsx' )
184184 }
185- if ( lang === 'ts' || lang === 'tsx' ) {
185+ if ( lang === 'ts' || lang === 'mts' || lang === ' tsx' || lang === 'mtsx ') {
186186 plugins . push ( [ 'typescript' , { dts } ] , 'explicitResourceManagement' )
187187 if ( ! userPlugins || ! userPlugins . includes ( 'decorators' ) ) {
188188 plugins . push ( 'decorators-legacy' )
Original file line number Diff line number Diff line change @@ -1139,12 +1139,12 @@ function parseFile(
11391139 parserPlugins ?: SFCScriptCompileOptions [ 'babelParserPlugins' ] ,
11401140) : Statement [ ] {
11411141 const ext = extname ( filename )
1142- if ( ext === '.ts' || ext === '.tsx' ) {
1142+ if ( ext === '.ts' || ext === '.mts' || ext === '. tsx' || ext === '.mtsx ') {
11431143 return babelParse ( content , {
11441144 plugins : resolveParserPlugins (
11451145 ext . slice ( 1 ) ,
11461146 parserPlugins ,
1147- filename . endsWith ( '.d.ts' ) ,
1147+ / \. d \. m ? t s $ / . test ( filename ) ,
11481148 ) ,
11491149 sourceType : 'module' ,
11501150 } ) . program . body
You can’t perform that action at this time.
0 commit comments