Skip to content

refactor(ES6): upgraded FlagIncludedChunksPlugin to ES6#3752

Merged
TheLarkInn merged 1 commit intowebpack:masterfrom
shubheksha:refactor-FlagIncludedChunksPlugin
Jan 4, 2017
Merged

refactor(ES6): upgraded FlagIncludedChunksPlugin to ES6#3752
TheLarkInn merged 1 commit intowebpack:masterfrom
shubheksha:refactor-FlagIncludedChunksPlugin

Conversation

@shubheksha
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?
refactor, ES5 => ES6

Did you add tests for your changes?
All existing tests pass

If relevant, link to documentation update:
N/A

Summary
Upgrade the FlagIncludedChunksPlugin to ES6

Does this PR introduce a breaking change?
No

Copy link
Copy Markdown
Member

@TheLarkInn TheLarkInn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@TheLarkInn TheLarkInn merged commit 80e177a into webpack:master Jan 4, 2017
if(chunkA === chunkB) return;
// is chunkB in chunkA?
if(chunkA.modules.length < chunkB.modules.length) return;
for(var i = 0; i < chunkB.modules.length; i++) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be simpler to use lodash

const _ = require('lodash');
...
if (_.difference(chunkB.modules, chunkA.modules).length === 0)
    chunkA.ids.push(chunkB.id);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants