-
-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: maxInitialRequests should exists in cache groups
- Loading branch information
Showing
15 changed files
with
135 additions
and
51 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
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
14 changes: 14 additions & 0 deletions
14
packages/rspack-test-tools/tests/configCases/split-chunks-common/rspack-issue-7509/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,14 @@ | ||
it("should not split chunk when maxInitialRequests set to only 1", function () { | ||
const a = require("./node_modules/a"); | ||
expect(a).toBe("a"); | ||
const b = require("./node_modules/b"); | ||
expect(b).toBe("b"); | ||
const c = require("./node_modules/c"); | ||
expect(c).toBe("c"); | ||
const d = require("./node_modules/d"); | ||
expect(d).toBe("d"); | ||
|
||
const fs = require('fs') | ||
const files = fs.readdirSync(__dirname) | ||
expect(files.filter(file => file.endsWith('.js')).length).toBe(1) | ||
}); |
1 change: 1 addition & 0 deletions
1
...pack-test-tools/tests/configCases/split-chunks-common/rspack-issue-7509/node_modules/a.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...pack-test-tools/tests/configCases/split-chunks-common/rspack-issue-7509/node_modules/b.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...pack-test-tools/tests/configCases/split-chunks-common/rspack-issue-7509/node_modules/c.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...pack-test-tools/tests/configCases/split-chunks-common/rspack-issue-7509/node_modules/d.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
...spack-test-tools/tests/configCases/split-chunks-common/rspack-issue-7509/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,20 @@ | ||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
optimization: { | ||
chunkIds: 'named', | ||
splitChunks: { | ||
maxInitialRequests: 10, | ||
cacheGroups: { | ||
vendors: { | ||
chunks: 'all', | ||
test: /node_modules/, | ||
minSize: 0, | ||
filename: 'split-[name].js', | ||
|
||
// should override the splitChunks.maxInitialRequests | ||
maxInitialRequests: 1, | ||
} | ||
} | ||
} | ||
} | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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