-
Notifications
You must be signed in to change notification settings - Fork 41
[Feature] Support html-webpack-plugin 4.x #16
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sibiraj-s, thanks for the PR!
Some comments below :)
package.json
Outdated
@@ -31,7 +31,7 @@ | |||
}, | |||
"peerDependencies": { | |||
"webpack": "^2 || ^3 || ^4", | |||
"html-webpack-plugin": "^2 || ^3" | |||
"html-webpack-plugin": "^2 || ^3 || ^4.0.0-alpah.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small sp mistake here: alpha
We'll probably wait for the major version to drop before merging this just incase the API changes, so let's also update this simply to ^4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 Will Update.
Eventually we will remove them, but that would require a major bump - the more backward compatibility we can keep, the less we break this plugin for anyone else who might be using it at the moment |
I'll mark this as Thanks for the contribution! |
Codecov Report
@@ Coverage Diff @@
## master #16 +/- ##
==========================================
- Coverage 98.79% 97.63% -1.17%
==========================================
Files 2 2
Lines 166 169 +3
Branches 9 10 +1
==========================================
+ Hits 164 165 +1
- Misses 2 4 +2
Continue to review full report at Codecov.
|
Updated html-webpack-plugin to beta. |
@AnujRNair Any ETA on merging this PR |
@sibiraj-s do you mind making the dependency |
done 👍 |
Hey I just tried the version on this branch, works super for me! one thing: processCsp(htmlPluginData, compileCb) {
const $ = cheerio.load(htmlPluginData.html, {
decodeEntities: false
});
let metaTag = $('meta[http-equiv="Content-Security-Policy"]');
// if not enabled, remove the empty tag
if (!this.isEnabled(htmlPluginData)) {
// HERE <----------------------- better to just bail out and call callback
return compileCb(null, htmlPluginData);
} otherwise
will insert
|
basically if |
Hi @phil-lgr! We added this line as some templates had empty CSP meta tags which we wanted to remove if the dev marked the plugin as disabled - we should expand this to check whether anything was actually removed or not - if so, return the new HTML, and if not, bail the plugin Would you be willing to make a PR for this change? |
Hello! I think it makes things more complicated:
IMO if the plugin is disabled it should not touch the template at all. Removing an empty CSP policy when People use html-plugin for other scenario than producing an index.html I use it to create my manifest.json: so I just want to stress that I need if you are ok with the above, I'll create a PR! 👍 |
we can create another option, maybe |
I've merged html webpack plugin 4 support in this PR: #23 to avoid going back and forth over merge conflicts :) Thanks for adding this in for us! |
Hi, I'd appreciate if you could reply to: #16 (comment) Again, we need to remove |
Hi @phil-lgr - sorry for the delayed response! I agree - this is an unfortunate side effect of simply including the plugin in your webpack config at the moment, and should change. I'll shortly be looking into how we can disable the plugin in a safe manner whilst still keeping backwards compatibility with the existing setup. Otherwise I will be shortly adding more features into the plugin which will require a major version bump, and I'll change the behaviour of the setting then Thanks! |
no worries, still appreciate the work done here ok, I'll keep an eye on that update then, thanks |
@phil-lgr are you able to provide me with a minimal sample repo reproducing the issue you're seeing? The webpack config and the HtmlWebpackPlugin template file you're using to create your manifest would be extremely beneficial |
I will prepare it!
On Wed, Dec 19, 2018 at 8:07 PM Anuj Nair <[email protected]<mailto:[email protected]>> wrote:
@phil-lgr<https://github.com/phil-lgr> are you able to provide me with a minimal sample repo reproducing the issue you're seeing? The webpack config and the HtmlWebpackPlugin template file you're using to create your manifest would be extremely beneficial
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#16 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AJMrQ2_SCXGfOplff3PALj_aGWcPTxV3ks5u6uLNgaJpZM4WymEy>.
…--
Phil Sent from Mobile
|
I suggest to open a new issue and track it separately, @phil-lgr If you think it is a bug or something else. The discussion is out of topic to this PR cc @AnujRNair |
Summary
Support html-webpack-plugin-4.x
Requirements
Closes #20