Last active
January 27, 2024 10:59
-
-
Save Endermanch/f721947054f18962fe48467eac46ec34 to your computer and use it in GitHub Desktop.
Vite build.rollupOptions.output.manualChunks() example to chunk per each vendor package (node_modules)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
vite: { | |
build: { | |
rollupOptions: { | |
output: { | |
manualChunks(id: string) { | |
if (id.includes('node_modules/')) { | |
return id | |
.split('node_modules/')[1] | |
.split('/')[0] | |
} | |
}, | |
}, | |
}, | |
}, | |
}, | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment