Skip to content
Snippets Groups Projects
Commit 6f1243f7 authored by syuilo's avatar syuilo
Browse files

Update vite.config.ts

parent fe0bb21b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
},
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment