-
-
Notifications
You must be signed in to change notification settings - Fork 39
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!: move packages to ESM first #418
feat!: move packages to ESM first #418
Conversation
await Promise.all([ | ||
rm(resolve(lib, 'types.cjs')), | ||
rm(resolve(lib, 'types.mjs')), | ||
...['vite', 'webpack'].map(async name => { |
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.
This is about removing the extra required .default
when requiring vite
or webpack
plugin (I don't use default export anymore to avoid this, you can remove the hack, run pnpm build && pnpm pack
from the package and upload the generated tgz to https://arethetypeswrong.github.io/ or just check https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md):
const webpack = require('@intlify/unplugin-vue-i18n/webpack').default
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.
Look good to me!
Thank you! ❤️
@userquin What is the tool that you used to detect those problems? |
@Tofandel I use publint and arethetypeswrong, both can be used with its own CLI, but I use their web version for a quick look at package exports. arethetypeswrong will use use TypeScript to apply resolutions for node10, node16 and bundler module resolutions: will show the trace and some hints with the problems and how to solve them. Visit https://arethetypeswrong.github.io/?p=%40intlify%2Funplugin-vue-i18n%405.3.1:
Daniel Roe added arethetypeswrong CLI workflow to Nuxt and later I added it to UnoCSS: |
This PR moves
@intlify/bundle-utils
and@intlify/unplugin-vue-i18n
to ESM first (right now CJS) fixing packages exports in both packages.Without this PR
@intlify/bundle-utils
@intlify/unplugin-vue-i18n
With this PR
@intlify/bundle-utils
@intlify/unplugin-vue-i18n