Skip to content

Commit

Permalink
fix: unchunk node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Crissium committed Mar 2, 2024
1 parent 7664eea commit 548d4d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
8 changes: 0 additions & 8 deletions client/README.md

This file was deleted.

15 changes: 14 additions & 1 deletion client/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ export default defineConfig({
// End workaround

build: {
outDir: 'build'
outDir: 'build',
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString();
}
},
// Don't append hashes to filenames, anyway we only generate one index.js and there definitely won't be a conflict with other files
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`
}
}
}
});

0 comments on commit 548d4d1

Please sign in to comment.