-
Couldn't load subscription status.
- Fork 340
Add a setting to configure skip common chunks behaviour globally #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a setting to configure skip common chunks behaviour globally #318
Conversation
Thanks. Please feel free to add this global setting behavior with tests too. Please test if the skip_common_chunks arg properly overrides the settings in all cases.
In near future, we can make this the default behavior, as it is on Webpack's own html-webpack-plugin.
Ok, that sounds great, I will put something together!
7b4292c to
4aa0ee3
Compare
@fjsj I've reworked this PR, let me know what you think of this approach.
You can now specify a 'SKIP_COMMON_CHUNKS' setting globally for each Webpack configuration. This will perform the same 'skip_common_chunks' logic from the 'render_bundle' template tag without having to add a parameter to every tag. To maintain backwards compatibility we default to 'False' and allow common chunks to be rendered to the HTML document as script tags. In the future, it will be easy to change this default behaviour if desired. I've added test coverage to ensure that the global setting can be override by the existing template tag parameter and that we maintain backwards compatibility.
56aa00f to
7498eb6
Compare
@fjsj Just wanted to bump this since it's been a couple of weeks.
Thanks, I'll be checking this in the next couple of days.
Released on 1.6.0. Thanks!
Thanks so much @fjsj!
Uh oh!
There was an error while loading. Please reload this page.
(削除) This is untested code but I am wondering if there is an appetite for a feature like this which would allow you to setskip_common_chunksper config without having to addskip_common_chunks=Trueto all of yourrender_bundletemplate tags. I realize this is likely an edge case but it would be helpful to have it as a setting instead of solely a template tag option. (削除ここまで)You can now specify a
SKIP_COMMON_CHUNKSsetting globally for each Webpack configuration. This will perform the sameskip_common_chunkslogic from therender_bundletemplate tag without having to add a parameter to every tag.To maintain backwards compatibility we default to 'False' and allow common chunks to be rendered to the HTML document as script tags. In the future, it will be easy to change this default behaviour if desired.
I've added test coverage to ensure that the global setting can be overridden by the existing template tag parameter and that we maintain backward compatibility.