diff options
Diffstat (limited to 'packages/frontend/vite.config.ts')
| -rw-r--r-- | packages/frontend/vite.config.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/packages/frontend/vite.config.ts b/packages/frontend/vite.config.ts index 7e21b3d850..425f3aa45d 100644 --- a/packages/frontend/vite.config.ts +++ b/packages/frontend/vite.config.ts @@ -1,7 +1,6 @@ import path from 'path'; import pluginVue from '@vitejs/plugin-vue'; -import { defineConfig } from 'vite'; -import { configDefaults as vitestConfigDefaults } from 'vitest/config'; +import { type UserConfig, defineConfig } from 'vite'; import locales from '../../locales'; import meta from '../../package.json'; @@ -38,7 +37,7 @@ function toBase62(n: number): string { return result; } -export default defineConfig(({ command, mode }) => { +export function getConfig(): UserConfig { return { base: '/vite/', @@ -62,7 +61,7 @@ export default defineConfig(({ command, mode }) => { css: { modules: { - generateScopedName: (name, filename, css) => { + generateScopedName(name, filename, _css): string { const id = (path.relative(__dirname, filename.split('?')[0]) + '-' + name).replace(/[\\\/\.\?&=]/g, '-').replace(/(src-|vue-)/g, ''); if (process.env.NODE_ENV === 'production') { return 'x' + toBase62(hash(id)).substring(0, 4); @@ -132,4 +131,8 @@ export default defineConfig(({ command, mode }) => { }, }, }; -}); +} + +const config = defineConfig(({ command, mode }) => getConfig()); + +export default config; |