-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Using integrity: true
with HtmlWebpackPlugin
_without_ an HTML entry fails
#107
Comments
The html bundler can handeln only The integrity option makes a seance only for a generated HTML with |
If you add a check to ensure Since a webpack config can be created to conditionally include entry points based on conditions/flags a user provides, I could see cases where someone would end up with a config that doesn't have an HTML files to compile, like in debugging (me, today), partial compilation (common in large projects and microservices), or an empty entry point directory specified via the directory feature (maybe it's generated from a boilerplate project and no HTML files have been created/needed). Anyway, I think you should reconsider this plugin's lack of ability to be a complete "No Op" when it doesn't need to do any work. I don't think it should have errored in this case. |
Thanks for clarifying. |
@davidmurdoch the issue is fixed in the v3.17.2 |
Current behaviour
This is a weird issue because it's not really a use case for this plugin. I only discovered it while try to debug an issue when using the cache (might open another issue for that later).
If
integrity: true
is set , and there are no HTML entries (with a script tag to add integrity to, I think), the plugin throws an error.The following config causes a failure:
The error message when running
npx -y webpack
:Expected behaviour
It shouldn't error :-)
I think you just need to check that
hashes
exists before trying to iterate.Reproduction
Environment
Additional context
Appreciation for the useful project
The text was updated successfully, but these errors were encountered: