-
-
Notifications
You must be signed in to change notification settings - Fork 933
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
Vue i18n Advanced Optimization #131
Comments
Just add these 2 options on // https://github.com/intlify/vite-plugin-vue-i18n
VueI18n({
runtimeOnly: true,
compositionOnly: true,
include: [path.resolve(__dirname, 'locales/**')],
}), |
Okay, thank you, I see. Should this be added as a default configuration for vitesse? |
@antfu I can make a PR, I have it prepared on local... |
You still have the warning on |
@YunYouJun only on buid and runtimeOnly flag to true: https://github.com/intlify/bundle-tools/blob/main/packages/vite-plugin-vue-i18n/src/index.ts#L66 |
If you want to remove the warning on |
@antfu these 2 options are by default true so we dont need to change it, I just explicity set to true on the plugin to be used with vue 3, but for vue 2 will not work, I miss you change adding vue-demi so maybe we need to add some hint on docs |
Hello, i just use this template and run it.
I can see a warning message in console.
vue-i18n.esm-bundler.js:46 You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.
Of course, we can turn off the warning like this.
Do we need set
boolean literals
to replacefeature flag globals
? (Sorry, i can not understand what do we need to do.)In addition, I read the documentation of vue-i18n.
Should we add it as part of the vite template?
If you need, I can create a PR for it.
Thanks.
The text was updated successfully, but these errors were encountered: