Skip to content

Commit 3ce8773

Browse files
sxzzyyx990803
authored andcommitted
feat: support import attributes syntax
upgrade babel and add `importAttributes` for parser plugin. TypeScript already supports this syntax [proposal](https://github.com/tc39/proposal-import-attributes)
1 parent 0dc875d commit 3ce8773

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/compiler-sfc/src/script/context.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ export function resolveParserPlugins(
164164
}
165165
if (lang === 'ts' || lang === 'tsx') {
166166
plugins.push(['typescript', { dts }])
167+
if (!plugins.includes('importAssertions')) {
168+
plugins.push(['importAttributes', { deprecatedAssertSyntax: true }])
169+
}
167170
if (!userPlugins || !userPlugins.includes('decorators')) {
168171
plugins.push('decorators-legacy')
169172
}

0 commit comments

Comments
 (0)