P粉3434089292023-08-25 10:21:09
EDIT: Here is a workaround, just hide the warning
Add command in vite.config.js
build: { chunkSizeWarningLimit: 1600, },
Complete code
// https://vitejs.dev/config/ export default defineConfig({ base: "/Stakepool-Frontend/", plugins: [vue()], resolve: { alias: { "~": path.resolve(__dirname, "node_modules"), "@": path.resolve(__dirname, "src"), }, }, build: { chunkSizeWarningLimit: 1600, }, });
P粉1535039892023-08-25 00:02:56
If you don't want to increase chunkSizeWarningLimit
and are more concerned with solving the actual size problem, try the following solutions:
export default defineConfig({ .... build: { rollupOptions: { output:{ manualChunks(id) { if (id.includes('node_modules')) { return id.toString().split('node_modules/')[1].split('/')[0].toString(); } } } } } });