Skip to content

Commit 8116b33

Browse files
committed
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 021a47a commit 8116b33

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ export function resolveParserPlugins(
163163
userPlugins = userPlugins.filter(p => p !== 'jsx')
164164
}
165165
if (lang === 'ts' || lang === 'tsx') {
166-
plugins.push(['typescript', { dts }])
166+
plugins.push(
167+
['typescript', { dts }],
168+
['importAttributes', { deprecatedAssertSyntax: true }]
169+
)
167170
if (!plugins.includes('decorators')) {
168171
plugins.push('decorators-legacy')
169172
}

0 commit comments

Comments
 (0)