Skip to content

Commit

Permalink
Fixed code splitting
Browse files Browse the repository at this point in the history
When running a dev server, renaming chunks doesn't work as expected.
  • Loading branch information
felixgirault committed Oct 11, 2024
1 parent 2e54969 commit 51b4d35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ module.exports = {
filename: 'orejime.js',
chunkFilename: (pathData) => {
// strips file names from generated chunk names
return pathData.chunk.name.replace(/(\-ts|\-index\-ts)$/, '.js');
return isDev
? pathData.chunk.name
: pathData.chunk.name.replace(/(\-ts|\-index\-ts)$/, '.js');
},
path: fullPath('dist'),
publicPath: ''
Expand Down

0 comments on commit 51b4d35

Please sign in to comment.