Update vite.config.ts

This commit is contained in:
syuilo 2023-01-14 11:10:41 +09:00
parent 668aa17eef
commit 027ef1ea4a

View File

@ -1,3 +1,4 @@
import path from 'path';
import pluginVue from '@vitejs/plugin-vue';
import { defineConfig } from 'vite';
@ -62,7 +63,8 @@ export default defineConfig(({ command, mode }) => {
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;
//return 'x' + toBase62(hash(`${filename} ${name}`)).substring(0, 4) + '-' + name;
return (path.relative(__dirname, filename.split('?')[0]) + '-' + name).replace(/[\\\/\.\?&=]/g, '-').replace(/(src-|vue-)/g, '');
}
},
},