diff --git a/packages/frontend/vite.config.ts b/packages/frontend/vite.config.ts index 506d1fa6a..ba82eda60 100644 --- a/packages/frontend/vite.config.ts +++ b/packages/frontend/vite.config.ts @@ -60,11 +60,11 @@ export default defineConfig(({ command, mode }) => { css: { modules: { generateScopedName: (name, filename, css) => { + 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(`${filename} ${name}`)).substring(0, 4); + return 'x' + toBase62(hash(id)).substring(0, 4); } else { - //return 'x' + toBase62(hash(`${filename} ${name}`)).substring(0, 4) + '-' + name; - return (path.relative(__dirname, filename.split('?')[0]) + '-' + name).replace(/[\\\/\.\?&=]/g, '-').replace(/(src-|vue-)/g, ''); + return id; } }, },