Skip to content

Commit

Permalink
Remove manual chunks and disable inlining assets (#351)
Browse files Browse the repository at this point in the history
* Starting to fine tune manual chunks

* Using the smallest preset for treeshaking with side effects true

* Just MUI?

* Forget about manual chunks and other Rollup tuning, just makes things worse
  • Loading branch information
paazmaya authored Jan 16, 2024
1 parent aecdebd commit b48be4f
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
import { defineConfig } from "vite";

import react from "@vitejs/plugin-react";

/*
Saved for later use once other libraries are being updated.
function manualChunks(id : string) {
if (id.includes('node_modules/react')) {
return 'react';
} else if (id.includes('node_modules/@material-ui')) {
return 'material';
} else if (id.includes('node_modules')) {
return 'vendor';
}
}
*/

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
Expand All @@ -31,17 +17,10 @@ export default defineConfig({
build: {
outDir: "build",
sourcemap: true,
assetsInlineLimit: 0, // disable inlining assets

// When false, all CSS will be extracted into a single CSS file.
cssCodeSplit: false,

// https://rollupjs.org/configuration-options/
/*
rollupOptions: {
output: {
manualChunks: manualChunks
}
}
*/
},
});

0 comments on commit b48be4f

Please sign in to comment.