Skip to content

Commit

Permalink
perf: 修改分包策略
Browse files Browse the repository at this point in the history
  • Loading branch information
huangmingfu committed Nov 1, 2024
1 parent 99d41cb commit ab9285c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,17 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
legalComments: 'none'
},
build: {
target: 'esnext', // target: 'es2015',
target: 'esnext', // 'es2015'
outDir: env.VITE_OUT_DIR || 'dist',
minify: 'esbuild',
chunkSizeWarningLimit: 1500,
sourcemap: false,
rollupOptions: {
output: {
chunkFileNames: 'assets/js/[name]-[hash].js',
entryFileNames: 'assets/js/[name]-[hash].js',
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]'
// manualChunks: {
// vendor: ['antd']
// }
chunkFileNames: 'js/[name]-[hash].js',
entryFileNames: 'js/[name]-[hash].js',
assetFileNames: '[ext]/[name]-[hash].[ext]',
manualChunks: {
'react-vendor': ['react', 'react-dom', 'react-router-dom']
}
}
}
}
Expand Down

0 comments on commit ab9285c

Please sign in to comment.