问题描述:项目中使用vue-i18n在控制台中显示以下警告。
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.
解决方法:在vite.config.ts中加入如下配置
alias: {
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
},