GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #6685 from webpack/bugfix/node_chunks · webpack/webpack@6879ab7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/node
    • NodeMainTemplatePlugin.js
  • test/configCases/async-commons-chunk/node
    • index.js
    • modules
      • a.js
      • b.js
      • c.js
    • webpack.config.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/node/NodeMainTemplatePlugin.js‎

Copy file name to clipboardExpand all lines: lib/node/NodeMainTemplatePlugin.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ module.exports = class NodeMainTemplatePlugin {
2929
"// object to store loaded chunks",
3030
'// "0" means "already loaded"',
3131
"var installedChunks = {",
32-
Template.indent(chunk.ids.map(id => `${id}: 0`).join(",\n")),
32+
Template.indent(
33+
chunk.ids.map(id => `${JSON.stringify(id)}: 0`).join(",\n")
34+
),
3335
"};"
3436
]);
3537
}
Collapse file

‎test/configCases/async-commons-chunk/node/index.js‎

Copy file name to clipboard
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import "./modules/a";
2+
3+
it("should load", done => {
4+
Promise.all([import("./modules/b"), import("./modules/c")]).then(() => {
5+
done();
6+
});
7+
});
Collapse file

‎test/configCases/async-commons-chunk/node/modules/a.js‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import "./b";
2+
3+
export default "a";
Collapse file

‎test/configCases/async-commons-chunk/node/modules/b.js‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default "b";
Collapse file

‎test/configCases/async-commons-chunk/node/modules/c.js‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import("./a");
2+
3+
export default "c";
Collapse file

‎test/configCases/async-commons-chunk/node/webpack.config.js‎

Copy file name to clipboard
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
mode: "none",
3+
entry: {
4+
"foo/bar": "./"
5+
},
6+
target: "node",
7+
optimization: {
8+
namedChunks: true,
9+
namedModules: true
10+
}
11+
};

0 commit comments

Comments
0 (0)
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.