-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: import assertions for genImport
and genDynamicImport
#34
Conversation
@@ -29,6 +29,7 @@ | |||
"devDependencies": { | |||
"@nuxtjs/eslint-config-typescript": "latest", | |||
"c8": "latest", | |||
"@vitest/coverage-c8": "latest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## main #34 +/- ##
=========================================
+ Coverage 0 95.55% +95.55%
=========================================
Files 0 7 +7
Lines 0 225 +225
Branches 0 72 +72
=========================================
+ Hits 0 215 +215
- Misses 0 10 +10
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
genImport
and genDynamicImport
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 💯
motivation
In
@nuxtjs/i18n
, we need to import i18n resources such as JSON.nuxt-modules/i18n#1518 (comment)
implementation
This PR is implemented with
{ assert?: { type: string } }
ofCodegenOptions
.Ideally, the arguments of functions such as
genImport
should be implemented with a few more changes as defined in the tc39 spec.https://tc39.es/proposal-import-assertions/
However, that would be a breaking change since it would change the interface, and it would affect the nuxt3 release schedule. so we are implementing it this way.