Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11602 from webpack/bugfix/shared-runtime-chunk
fix crash when using shared with runtimeChunk
- Loading branch information
Showing
6 changed files
with
30 additions
and
0 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
5 changes: 5 additions & 0 deletions
5
test/configCases/sharing/provide-shared-with-runtime-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,5 @@ | ||
import x from "x"; | ||
|
||
it("should work", () => { | ||
expect(x).toBe(42); | ||
}); |
1 change: 1 addition & 0 deletions
1
test/configCases/sharing/provide-shared-with-runtime-chunk/node_modules/x/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
test/configCases/sharing/provide-shared-with-runtime-chunk/node_modules/x/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
test/configCases/sharing/provide-shared-with-runtime-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,5 @@ | ||
module.exports = { | ||
findBundle: function () { | ||
return ["./runtime.js", "./main.js"]; | ||
} | ||
}; |
15 changes: 15 additions & 0 deletions
15
test/configCases/sharing/provide-shared-with-runtime-chunk/webpack.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,15 @@ | ||
const { ProvideSharedPlugin } = require("../../../../").sharing; | ||
/** @type {import("../../../../").Configuration} */ | ||
module.exports = { | ||
output: { | ||
filename: "[name].js" | ||
}, | ||
optimization: { | ||
runtimeChunk: "single" | ||
}, | ||
plugins: [ | ||
new ProvideSharedPlugin({ | ||
provides: ["x"] | ||
}) | ||
] | ||
}; |