feat(i18n): 重构国际化组件,添加新的语言支持和功能
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||
import { unheadVueComposablesImports } from '@unhead/vue';
|
||||
import { VantResolver } from '@vant/auto-import-resolver';
|
||||
import Vue from '@vitejs/plugin-vue';
|
||||
import VueJsx from '@vitejs/plugin-vue-jsx';
|
||||
import { fileURLToPath, URL } from 'node:url';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath, resolve, URL } from 'node:url';
|
||||
import UnoCSS from 'unocss/vite';
|
||||
import { type ImportsMap } from 'unplugin-auto-import/types';
|
||||
import AutoImport from 'unplugin-auto-import/vite';
|
||||
@ -90,7 +92,15 @@ function Plugins() {
|
||||
plugins.push(
|
||||
AutoImport({
|
||||
resolvers: [TDesignResolver({ library: 'mobile-vue', esm: true }), VantResolver({ importStyle: true })],
|
||||
imports: ['vue', 'pinia', '@vueuse/core', VueRouterAutoImports, unheadVueComposablesImports, Utils4uAutoImports],
|
||||
imports: [
|
||||
'vue',
|
||||
'pinia',
|
||||
'@vueuse/core',
|
||||
VueRouterAutoImports,
|
||||
unheadVueComposablesImports,
|
||||
Utils4uAutoImports,
|
||||
'vue-i18n',
|
||||
],
|
||||
}),
|
||||
Components({
|
||||
// allow auto load markdown components under `./src/components/`
|
||||
@ -131,6 +141,14 @@ function Plugins() {
|
||||
]),
|
||||
);
|
||||
|
||||
plugins.push(
|
||||
VueI18nPlugin({
|
||||
/* options */
|
||||
// locale messages resource pre-compile option
|
||||
include: resolve(dirname(fileURLToPath(import.meta.url)), './path/to/src/locales/**'),
|
||||
}),
|
||||
);
|
||||
|
||||
plugins.push(
|
||||
// https://github.com/condorheroblog/vite-plugin-fake-server?tab=readme-ov-file#usage
|
||||
vitePluginFakeServer({
|
||||
|
Reference in New Issue
Block a user