Skip to content

Add "single" option to RuntimeChunkPlugin - #6384

Merged
sokra merged 4 commits into
webpack:nextfrom
benthemonkey:next
Feb 5, 2018
Merged

sokra merged 4 commits into
webpack:nextfrom
benthemonkey:next

Conversation

@benthemonkey

@benthemonkey benthemonkey commented Jan 25, 2018 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Add config option optimization.runtimeChunk: 'single' to generate a single runtime chunk for all entrypoints instead of each entrypoint getting their own runtime.

Did you add tests for your changes?

Basic tests for the existence of runtime files, nothing that tests that the contents of the runtime file are generated correctly.

If relevant, link to documentation update:

Summary

My company's webpack setup involves including multiple entrypoint files on a page, so adding a separate runtime chunk for each entrypoint results in too many parallel loading chunks.

See @sokra's comment in the alpha.5 issue: #6357 (comment)

Does this PR introduce a breaking change?

No, just a new option in the config and the RuntimeChunkPlugin.

Other information

Let me know if you approve of the way I am handling passing in the option. Once I get a 👍 I'll update docs and add tests. I mostly wanted to make sure you won't want to allow a custom name for the runtime chunk.

@jsf-clabot

jsf-clabot commented Jan 25, 2018 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread schemas/WebpackOptions.json Outdated
},
{
"enum": [
"single"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please also add the counterpart

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you mean I should add another string option called multiple?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes.

change runtime chunk naming schema
@webpack-bot

Copy link
Copy Markdown
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@sokra
sokra merged commit b50a5b6 into webpack:next Feb 5, 2018
@sokra

sokra commented Feb 5, 2018

Copy link
Copy Markdown
Member

Thanks

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.

5 participants