Merge pull request #15536 from webpack/fix/issue-15518
fix allDeps list
This commit is contained in:
commit
129477d11d
|
@ -1104,9 +1104,13 @@ module.exports = webpackEmptyAsyncContext;`;
|
|||
)
|
||||
);
|
||||
const set = new Set();
|
||||
const allDeps = /** @type {ContextElementDependency[]} */ (
|
||||
this.dependencies.concat(this.blocks.map(b => b.dependencies[0]))
|
||||
);
|
||||
const allDeps =
|
||||
this.dependencies.length > 0
|
||||
? /** @type {ContextElementDependency[]} */ (this.dependencies).slice()
|
||||
: [];
|
||||
for (const block of this.blocks)
|
||||
for (const dep of block.dependencies)
|
||||
allDeps.push(/** @type {ContextElementDependency} */ (dep));
|
||||
set.add(RuntimeGlobals.module);
|
||||
set.add(RuntimeGlobals.hasOwnProperty);
|
||||
if (allDeps.length > 0) {
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export const log = 1;
|
|
@ -0,0 +1,13 @@
|
|||
async function dynamic_import(dir, name) {
|
||||
if (dir === "a") {
|
||||
return import(
|
||||
/* webpackChunkName: "a" */
|
||||
/* webpackMode: "lazy-once" */
|
||||
`./dynamic_a/${name}.js`);
|
||||
}
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
it("should compile and run", async () => {
|
||||
await dynamic_import("a", "module_a1");
|
||||
});
|
Loading…
Reference in New Issue