描述
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 文件中
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8000/api',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
alias: {
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
},
plugins: [vue()],
});
关键配置
alias: {
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
},
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。