Split the bloated date libs to a separate module that rarely changes, speeding up page loads when the app itself has changed.
This commit is contained in:
@@ -15,4 +15,18 @@ export default defineConfig({
|
|||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
build: {
|
||||||
|
chunkSizeWarningLimit: 1500,
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
manualChunks: (id) => {
|
||||||
|
if (id.includes('node_modules/date-fns') ||
|
||||||
|
id.includes('node_modules/date-fns-tz') ||
|
||||||
|
id.includes('node_modules/date-holidays')) {
|
||||||
|
return 'vendor-date-libs';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user