|
@@ -27,6 +27,25 @@ export default defineConfig({
|
|
|
},
|
|
|
build: {
|
|
|
outDir: 'horz_chart',
|
|
|
+ chunkSizeWarningLimit: 800,//单文件过800kb警告
|
|
|
+ rollupOptions: {
|
|
|
+ output: {
|
|
|
+ manualChunks(id) {
|
|
|
+ if (id.includes('node_modules')) {
|
|
|
+ return id.toString()
|
|
|
+ .split('node_modules/')[1]
|
|
|
+ .split('/')[0]
|
|
|
+ .toString();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ chunkFileNames: (info) => {
|
|
|
+ const facadeModuleId = info.facadeModuleId ?
|
|
|
+ info.facadeModuleId.split('/') : [];
|
|
|
+ const fileName = facadeModuleId[facadeModuleId.length -2] || '[name]'
|
|
|
+ return `js/${fileName}/[name].[hash].js`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
resolve: {
|
|
|
alias: {
|