Skip to content

Commit

Permalink
手动分块 manualChunks
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankFang committed Mar 22, 2023
1 parent 1109e4b commit be0f74b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ import { svgsprites } from './vite_plugins/svgsprites'
export default defineConfig((env) => {
const { command } = env
return {
build: {
rollupOptions: {
output: {
manualChunks(id: any) {
if (id.includes('echarts')) {
return 'echarts'
}
if (id.includes('node_modules')) {
return 'vendor'
}
}
}
}
},
server: {
proxy: {
'/api/': {
Expand Down

0 comments on commit be0f74b

Please sign in to comment.