-
-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: reuseExistingChunk should be false by default (#7489)
* fix: reuseExistingChunk should be false by default * docs: add docs for reuseExistingChunk * Update website/docs/zh/plugins/webpack/split-chunks-plugin.mdx Co-authored-by: neverland <chenjiahan.jait@bytedance.com> * Update website/docs/zh/plugins/webpack/split-chunks-plugin.mdx Co-authored-by: neverland <chenjiahan.jait@bytedance.com> * docs: modify some statements --------- Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
- Loading branch information
1 parent
32c3d09
commit f2ec947
Showing
9 changed files
with
110 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ages/rspack-test-tools/tests/configCases/split-chunks/default-reuse-existing-chunk/foo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const foo = 42; |
6 changes: 6 additions & 0 deletions
6
...es/rspack-test-tools/tests/configCases/split-chunks/default-reuse-existing-chunk/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import fs from 'fs' | ||
import path from 'path' | ||
|
||
it('should have extra chunk', () => { | ||
expect(fs.existsSync(path.resolve(__dirname, 'foo-index_js.js'))).toBe(true) | ||
}) |
19 changes: 19 additions & 0 deletions
19
...k-test-tools/tests/configCases/split-chunks/default-reuse-existing-chunk/rspack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
target: "node", | ||
output: { | ||
filename: "[name].js" | ||
}, | ||
optimization: { | ||
chunkIds: 'named', | ||
splitChunks: { | ||
minSize: 1, | ||
chunks: "all", | ||
cacheGroups: { | ||
foo: { | ||
minSize: 0, | ||
} | ||
} | ||
} | ||
} | ||
}; |
6 changes: 6 additions & 0 deletions
6
...ack-test-tools/tests/configCases/split-chunks/default-reuse-existing-chunk/test.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** @type {import("../../../..").TConfigCaseConfig} */ | ||
module.exports = { | ||
findBundle: function (i, options) { | ||
return ["main.js"]; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f2ec947
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Ran ecosystem CI: Open
f2ec947
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open