forked from webpack/webpack
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 webpack#12891 from webpack/bugfix/non-js-entry
fix problem with startup of non-js initial chunks
- Loading branch information
Showing
15 changed files
with
119 additions
and
52 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
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
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
6 changes: 6 additions & 0 deletions
6
test/configCases/web/non-js-chunks-entrypoint-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,6 @@ | ||
import p from "package"; | ||
import o from "other-package"; | ||
|
||
it("should run", () => { | ||
console.log.bind(console, p, o); | ||
}); |
1 change: 1 addition & 0 deletions
1
...onfigCases/web/non-js-chunks-entrypoint-runtime-chunk/node_modules/other-package/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
...gCases/web/non-js-chunks-entrypoint-runtime-chunk/node_modules/other-package/package.json
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
test/configCases/web/non-js-chunks-entrypoint-runtime-chunk/node_modules/package/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
.../configCases/web/non-js-chunks-entrypoint-runtime-chunk/node_modules/package/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
test/configCases/web/non-js-chunks-entrypoint-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,9 @@ | ||
module.exports = { | ||
findBundle: function (i, options) { | ||
return [ | ||
"runtime.js", | ||
"main.js", | ||
"vendors-node_modules_other-package_index_js-node_modules_package_index_js.js" | ||
]; | ||
} | ||
}; |
29 changes: 29 additions & 0 deletions
29
test/configCases/web/non-js-chunks-entrypoint-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,29 @@ | ||
const { ProvideSharedPlugin } = require("../../../../").sharing; | ||
|
||
/** @type {import("../../../../").Configuration} */ | ||
module.exports = { | ||
output: { | ||
filename: "[name].js" | ||
}, | ||
target: "web", | ||
optimization: { | ||
chunkIds: "named", | ||
runtimeChunk: "single", | ||
splitChunks: { | ||
chunks: "all", | ||
minSize: 1, | ||
cacheGroups: { | ||
share: { | ||
type: "provide-module", | ||
name: "provide-module", | ||
enforce: true | ||
} | ||
} | ||
} | ||
}, | ||
plugins: [ | ||
new ProvideSharedPlugin({ | ||
provides: ["package"] | ||
}) | ||
] | ||
}; |