) {
plugins.push('importAttributes')
}
- if (lang === 'jsx' || lang === 'tsx') {
+ if (lang === 'jsx' || lang === 'tsx' || lang === 'mtsx') {
plugins.push('jsx')
} else if (userPlugins) {
// If don't match the case of adding jsx
// should remove the jsx from user options
userPlugins = userPlugins.filter(p => p !== 'jsx')
}
- if (lang === 'ts' || lang === 'tsx') {
+ if (lang === 'ts' || lang === 'mts' || lang === 'tsx' || lang === 'mtsx') {
plugins.push(['typescript', { dts }], 'explicitResourceManagement')
if (!userPlugins || !userPlugins.includes('decorators')) {
plugins.push('decorators-legacy')
parserPlugins?: SFCScriptCompileOptions['babelParserPlugins'],
): Statement[] {
const ext = extname(filename)
- if (ext === '.ts' || ext === '.tsx') {
+ if (ext === '.ts' || ext === '.mts' || ext === '.tsx' || ext === '.mtsx') {
return babelParse(content, {
plugins: resolveParserPlugins(
ext.slice(1),
parserPlugins,
- filename.endsWith('.d.ts'),
+ /\.d\.m?ts$/.test(filename),
),
sourceType: 'module',
}).program.body