refactor(client): use css modules

This commit is contained in:
syuilo
2023-01-10 11:15:29 +09:00
parent d10e000883
commit 3f033d6ab7
5 changed files with 72 additions and 67 deletions

View File

@@ -59,7 +59,11 @@ export default defineConfig(({ command, mode }) => {
css: {
modules: {
generateScopedName: (name, filename, css) => {
return 'x' + toBase62(hash(`${filename} ${name}`)).substring(0, 4);
if (process.env.NODE_ENV === 'production') {
return 'x' + toBase62(hash(`${filename} ${name}`)).substring(0, 4);
} else {
return 'x' + toBase62(hash(`${filename} ${name}`)).substring(0, 4) + '-' + name;
}
},
},
},