From 6f1243f722650e75de3968a3dd9c37852de8aa5b Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 16 Jan 2023 13:59:14 +0900 Subject: [PATCH] Update vite.config.ts --- packages/frontend/vite.config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/frontend/vite.config.ts b/packages/frontend/vite.config.ts index 506d1fa6ab..ba82eda609 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; } }, },