Skip to content

Commit

Permalink
Split turms-admin output JS bundle to improve page load speed
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesChenX committed Dec 3, 2023
1 parent 2f9bc68 commit 1853430
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion turms-admin/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fileURLToPath, URL } from 'node:url';
import autoprefixer from 'autoprefixer';
import { defineConfig } from 'vite';
import { defineConfig, splitVendorChunkPlugin } from 'vite';
import vue from '@vitejs/plugin-vue';
import Components from 'unplugin-vue-components/vite';
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
Expand Down Expand Up @@ -49,6 +49,9 @@ export default defineConfig(({mode }) => ({
importStyle: false
})]
}),
// We don't split vendor into more chunks because
// it will cause chunks to run in wrong order.
splitVendorChunkPlugin(),
isReportMode
? visualizer({
filename: './build/.cache/stats.html',
Expand Down

0 comments on commit 1853430

Please sign in to comment.