Closed kmohrf closed 2 years ago
ping @arthurconexia :)
or maybe ping @arthurbergmz?
@arthurbergmz any chance?
@arthurbergmz ping
Closing this, because I’ve migrated away from webpack and want to get rid of this PR in my PR overview :). Feel free to merge the changes if you find the time.
Hi,
this PR changes the hook used by the tapable generator from
beforeEmit
that modifies the generated HTML toalterAssetTags
/alterAssetTagGroups
(depending on the html-webpack-plugin version), that inserts manifest tags into the data structure provided by the html-webpack-plugin.This makes it possible to use the webpack-pwa-manifest plugin for templates without a
head
tag. Until now that was not possible, because the manifest tags would be inserted before the closinghead
tag through string replacement. The following html-webpack-plugin configuration would produce a<head>
-less template:This is helpful in scenarios where the generated HTML is loaded into an existing
head
tag. In my case I include the generated HTML into my python-django application via the include mechanism of the template engine.This PR also changes a few other things. I’m not sure if they should end up in the same pull request, but YMMV:
package.json
. This enables native support for generator functions, which I use in my code.NOTE: I have not added tests for this because I’m not sure how to test the behaviour for html-webpack-plugin v4, as v3 is the one installed by dev-dependencies. I can confirm it’s working, because I myself use v4 in my project, but that is more like anecdotal evidence :). Feel free to make a suggestion on how to solve this and I’ll look into it.
Cheers
Konrad