Skip to content

Commit

Permalink
further adjust the output chunking for smaller bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
seapagan committed Jun 9, 2024
1 parent 5cc4b0d commit 4330f70
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default defineConfig(({ mode }) => {
"1c.js",
"maxima.js",
"sqf.js",
"gml.js",
];

return {
Expand All @@ -32,22 +33,18 @@ export default defineConfig(({ mode }) => {
},
}),
eslint(),
splitVendorChunkPlugin(),
ViteMinifyPlugin({}),
visualizer(),
],
build: {
rollupOptions: {
// external: id => {
// // Mark these specific dependencies as external
// if (external.some(ext => id.includes(ext))) {
// return true;
// }

// return false;
// },
output: {
manualChunks(id) {
for (const e of external) {
if (id.includes(e)) {
return "extra-lang";
}
}
if (id.includes("react-github-readme-button")) {
return "github-button";
}
Expand All @@ -57,6 +54,12 @@ export default defineConfig(({ mode }) => {
if (id.includes("@apollo")) {
return "@apollo";
}
if (id.includes("graphql")) {
return "graphql";
}
if (id.includes("node_modules")) {
return "vendor";
}
},
},
},
Expand Down

0 comments on commit 4330f70

Please sign in to comment.