Skip to content

Commit

Permalink
feat: support import attributes syntax
Browse files Browse the repository at this point in the history
upgrade babel and add `importAttributes` for parser plugin.

TypeScript already supports this syntax
[proposal](https://github.com/tc39/proposal-import-attributes)
  • Loading branch information
sxzz committed Sep 21, 2023
1 parent 021a47a commit 8116b33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/compiler-sfc/src/script/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ export function resolveParserPlugins(
userPlugins = userPlugins.filter(p => p !== 'jsx')
}
if (lang === 'ts' || lang === 'tsx') {
plugins.push(['typescript', { dts }])
plugins.push(
['typescript', { dts }],
['importAttributes', { deprecatedAssertSyntax: true }]
)
if (!plugins.includes('decorators')) {
plugins.push('decorators-legacy')
}
Expand Down

0 comments on commit 8116b33

Please sign in to comment.