Merge pull request #7445 from webpack/bugfix/no-id

rewrite module reference correctly after replacing ConcatenatedModule
This commit is contained in:
Tobias Koppers 2018-05-30 10:28:39 +02:00 committed by GitHub
commit 66cd9b7c80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -286,7 +286,13 @@ class ModuleConcatenationPlugin {
}
compilation.modules.push(newModule);
for (const reason of newModule.reasons) {
reason.dependency.module = newModule;
if (reason.dependency.module === concatConfiguration.rootModule)
reason.dependency.module = newModule;
if (
reason.dependency.redirectedModule ===
concatConfiguration.rootModule
)
reason.dependency.redirectedModule = newModule;
}
// TODO: remove when LTS node version contains fixed v8 version
// @see https://github.com/webpack/webpack/pull/6613

View File

@ -0,0 +1,8 @@
import { a } from "pmodule";
it("should not crash with null id", function() {
expect(a).toBe("a");
});
if(Math === undefined)
console.log(module); // prevent scope hoisting of this module