Skip to content

Commit

Permalink
Merge pull request #5160 from asmundg/fix-amd-deprecation-warning
Browse files Browse the repository at this point in the history
Replace deprecated Chunk.modules usage
  • Loading branch information
sokra committed Jul 1, 2017
2 parents 6199454 + 0c4ab4a commit 53944e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/AmdMainTemplatePlugin.js
Expand Up @@ -17,7 +17,7 @@ class AmdMainTemplatePlugin {
const mainTemplate = compilation.mainTemplate;

compilation.templatesPlugin("render-with-entry", (source, chunk, hash) => {
const externals = chunk.modules.filter((m) => m.external);
const externals = chunk.getModules().filter((m) => m.external);
const externalsDepsArray = JSON.stringify(externals.map((m) =>
typeof m.request === "object" ? m.request.amd : m.request
));
Expand Down
6 changes: 3 additions & 3 deletions test/AmdMainTemplatePlugin.test.js
Expand Up @@ -67,7 +67,7 @@ describe("AmdMainTemplatePlugin", () => {
describe("with name", () => {
beforeEach(() => {
env.chunk = {
modules: env.modulesListWithExternals
getModules: () => env.modulesListWithExternals
};
env.eventBinding = setupPluginAndGetEventBinding("foo");
});
Expand All @@ -82,7 +82,7 @@ describe("AmdMainTemplatePlugin", () => {
describe("with external dependencies", () => {
beforeEach(() => {
env.chunk = {
modules: env.modulesListWithExternals
getModules: () => env.modulesListWithExternals
};
env.eventBinding = setupPluginAndGetEventBinding();
});
Expand All @@ -101,7 +101,7 @@ describe("AmdMainTemplatePlugin", () => {
};
const noExternals = env.modulesListWithExternals.map((module) => Object.assign(module, externalFlag));
env.chunk = {
modules: noExternals
getModules: () => env.modulesListWithExternals
};
env.eventBinding = setupPluginAndGetEventBinding();
});
Expand Down

0 comments on commit 53944e8

Please sign in to comment.