Workbox: InjectManifest does not include index.html generated by html-webpack-plugin in 6.0.0-alpha.3

Created on 12 Nov 2020  路  4Comments  路  Source: GoogleChrome/workbox

Library Affected:
workbox-webpack-plugin 6.0.0-alpha.3

Browser & Platform:
Node JS

Issue or Feature Request Description:
When upgrading to @next, I noticed that the index.html generated by html-webpack-plugin is no longer included in the manifest entries list. This issue disappeared when I rolled back to 5.1.4 :)

I made a minimal repo demonstrating the problem here: https://github.com/dermoumi/workbox-inject-manifest

Hopefully this can help, keep up the good work guys!

Most helpful comment

For anyone else experiencing this issue - the fix only works for html-webpack-plugin versions in range >=5.0.0.

All 4 comments

Changing stage to PROCESS_ASSETS_STAGE_ANALYSE in https://github.com/GoogleChrome/workbox/blob/v6/packages/workbox-webpack-plugin/src/inject-manifest.js#L172 seems to fix the issue.

Looked into it on html-webpack-plugin's end, but it seems changing the stage there causes some extra issues: https://github.com/jantimon/html-webpack-plugin/blob/next/index.js#L211-L217

But then I'm not familiar with webpack plugins API nor do I know the implications of doing this. I'll push a PR anyway if it helps ._.

Thanks for investigating and reporting this issue! I know that @jantimon has been actively working with the webpack core team to find the "right" time to run various plugins so that they all are properly ordered.

Can you just confirm which version of html-webpack-plugin you saw this behavior with? I want to make sure that we're testing against the same thing in our test suite.

What I'd like to do before switching to PROCESS_ASSETS_STAGE_ANALYSE is get some feedback from the webpack core team, as PROCESS_ASSETS_STAGE_SUMMARIZE is explicitly documented as the stage to use when generating an asset manifest for a service worker.

I can reproduce using html-webpack-plugin versions 4.3.0 4.5.0 and 5.0.0-alpha.13

For anyone else experiencing this issue - the fix only works for html-webpack-plugin versions in range >=5.0.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kaycebasques picture kaycebasques  路  4Comments

thangman22 picture thangman22  路  4Comments

niveditaece picture niveditaece  路  3Comments

Sturgelose picture Sturgelose  路  3Comments

rafzan picture rafzan  路  3Comments