Skip to content

Commit

Permalink
feat(builder): apply chunkIds deterministic in Rspack mode production (
Browse files Browse the repository at this point in the history
  • Loading branch information
9aoy authored Sep 15, 2023
1 parent 074f9a3 commit 6b03be8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/stale-comics-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/builder-rspack-provider': patch
---

chore(builder): apply chunkIds deterministic in Rspack mode production

chore(builder): 在 Rspack 模式下,生产环境开启 chunkIds 'deterministic'
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import type { BuilderPlugin } from '../types';
export const builderPluginTransition = (): BuilderPlugin => ({
name: 'builder-plugin-transition',

setup() {
setup(api) {
process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent';

api.modifyBundlerChain(async (chain, { isProd }) => {
if (isProd) {
chain.optimization.chunkIds('deterministic');
}
});
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when prod
},
"name": "Client",
"optimization": {
"chunkIds": "deterministic",
"minimize": true,
"minimizer": [
Plugin {
Expand Down

0 comments on commit 6b03be8

Please sign in to comment.