refactor: updated i18n implementation in the admin dashboard (#3395)
* feat: introduced new unplugin i18n and removed the old vite i18n package * refactor: updated vite config to support the new plugin * refactor: removed irrelevant logic from the i18n module
This commit is contained in:
committed by
GitHub
parent
17d6ae15a5
commit
6c63a8dc28
@@ -2,23 +2,20 @@ import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
|
||||
import Icons from 'unplugin-icons/vite';
|
||||
import Unfonts from "unplugin-fonts/vite";
|
||||
import Unfonts from 'unplugin-fonts/vite';
|
||||
import IconResolver from 'unplugin-icons/resolver';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import WindiCSS from 'vite-plugin-windicss';
|
||||
import Pages from 'vite-plugin-pages';
|
||||
import Layouts from 'vite-plugin-vue-layouts';
|
||||
import VueI18n from '@intlify/vite-plugin-vue-i18n';
|
||||
import path from 'path';
|
||||
import ImportMetaEnv from "@import-meta-env/unplugin"
|
||||
import ImportMetaEnv from '@import-meta-env/unplugin';
|
||||
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
envPrefix:
|
||||
process.env.HOPP_ALLOW_RUNTIME_ENV
|
||||
? "VITE_BUILDTIME_"
|
||||
: "VITE_",
|
||||
envDir: path.resolve(__dirname, "../.."),
|
||||
envPrefix: process.env.HOPP_ALLOW_RUNTIME_ENV ? 'VITE_BUILDTIME_' : 'VITE_',
|
||||
envDir: path.resolve(__dirname, '../..'),
|
||||
server: {
|
||||
port: 3100,
|
||||
},
|
||||
@@ -38,10 +35,10 @@ export default defineConfig({
|
||||
defaultLayout: 'default',
|
||||
layoutsDirs: 'src/layouts',
|
||||
}),
|
||||
VueI18n({
|
||||
VueI18nPlugin({
|
||||
runtimeOnly: false,
|
||||
compositionOnly: true,
|
||||
include: [path.resolve(__dirname, 'locales')],
|
||||
include: [path.resolve(__dirname, './locales/**')],
|
||||
}),
|
||||
WindiCSS({
|
||||
root: path.resolve(__dirname),
|
||||
@@ -78,24 +75,24 @@ export default defineConfig({
|
||||
fontsource: {
|
||||
families: [
|
||||
{
|
||||
name: "Inter Variable",
|
||||
variables: ["variable-full"],
|
||||
name: 'Inter Variable',
|
||||
variables: ['variable-full'],
|
||||
},
|
||||
{
|
||||
name: "Material Symbols Rounded Variable",
|
||||
variables: ["variable-full"],
|
||||
name: 'Material Symbols Rounded Variable',
|
||||
variables: ['variable-full'],
|
||||
},
|
||||
{
|
||||
name: "Roboto Mono Variable",
|
||||
variables: ["variable-full"],
|
||||
name: 'Roboto Mono Variable',
|
||||
variables: ['variable-full'],
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
}),
|
||||
process.env.HOPP_ALLOW_RUNTIME_ENV
|
||||
? ImportMetaEnv.vite({
|
||||
example: "../../.env.example",
|
||||
env: "../../.env",
|
||||
? ImportMetaEnv.vite({
|
||||
example: '../../.env.example',
|
||||
env: '../../.env',
|
||||
})
|
||||
: [],
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user