File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,12 +104,24 @@ export default defineConfig(({ mode }) => ({
104104 rolldownOptions : {
105105 // default entrypoint for vite is '<root>/index.html', so we don't have to set it
106106 output : {
107- // React Router automatically splits any route module into its own file,
108- // but some end up being like 300 bytes. It feels silly to have several
109- // hundred of those, so we set a minimum size to end up with fewer.
110- // https://rolldown.rs/in-depth/advanced-chunks
107+ // Merge tiny shared chunks to reduce the number of requests.
108+ // Rolldown has this instead of Rollup's experimentalMinChunkSize;
109+ // https://github.com/rolldown/rolldown/issues/4788
111110 codeSplitting : {
112- groups : [ { name : 'small-chunks' , minSize : 30 * KiB } ] ,
111+ groups : [
112+ {
113+ name : 'vendor' ,
114+ test : / \/ n o d e _ m o d u l e s \/ / ,
115+ minSize : 4096 ,
116+ maxSize : 1000 * 1000 ,
117+ } ,
118+ {
119+ name : 'shared' ,
120+ minSize : 4096 ,
121+ maxSize : 1000 * 1000 ,
122+ minShareCount : 2 ,
123+ } ,
124+ ] ,
113125 } ,
114126 } ,
115127 } ,
You can’t perform that action at this time.
0 commit comments