diff --git a/packages/fes-plugin-locale/src/index.js b/packages/fes-plugin-locale/src/index.js index d20ab6ac..b30f0bd1 100644 --- a/packages/fes-plugin-locale/src/index.js +++ b/packages/fes-plugin-locale/src/index.js @@ -9,6 +9,10 @@ export default (api) => { utils: { Mustache } } = api; + api.chainWebpack((memo) => { + memo.resolve.alias.set('vue-i18n', 'vue-i18n/dist/vue-i18n.esm-bundler.js'); + }); + api.describe({ key: 'locale', config: { diff --git a/packages/fes-plugin-locale/src/runtime/core.tpl b/packages/fes-plugin-locale/src/runtime/core.tpl index b5f40e9c..3372a7ef 100644 --- a/packages/fes-plugin-locale/src/runtime/core.tpl +++ b/packages/fes-plugin-locale/src/runtime/core.tpl @@ -6,7 +6,7 @@ // 其他插件可以运行时修改配置 // 所有插件使用一个语言和配置 import { isRef } from 'vue'; -import { createI18n, useI18n } from 'vue-i18n/dist/vue-i18n.esm-bundler.js'; +import { createI18n, useI18n } from 'vue-i18n'; import { plugin, ApplyPluginsType } from "@@/core/coreExports"; import SelectLang from "./views/SelectLang"; diff --git a/packages/fes-plugin-locale/src/runtime/views/SelectLang.vue b/packages/fes-plugin-locale/src/runtime/views/SelectLang.vue index 83b182c3..13818b70 100644 --- a/packages/fes-plugin-locale/src/runtime/views/SelectLang.vue +++ b/packages/fes-plugin-locale/src/runtime/views/SelectLang.vue @@ -22,7 +22,7 @@ import Menu from 'ant-design-vue/lib/menu'; import 'ant-design-vue/lib/dropdown/style'; import 'ant-design-vue/lib/menu/style'; import { GlobalOutlined } from '@ant-design/icons-vue'; -import { useI18n } from 'vue-i18n/dist/vue-i18n.esm-bundler'; +import { useI18n } from 'vue-i18n'; import { computed } from 'vue'; import langUConfigMap from '../langUConfigMap';