Skip to content
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

mode isn't supported by workbox-build's injectManifest or getManifest #2427

Closed
Westbrook opened this issue Mar 29, 2020 · 2 comments
Closed
Assignees
Labels
Breaking Change Denotes a "major" semver change. Documentation Related to our docs. workbox-build

Comments

@Westbrook
Copy link

Library Affected:
workbox-build

Browser & Platform:
MacOS, but seemingly all.

Issue or Feature Request Description:
Currently, both generateSW and injectManifest API for workbox-build support the mode option in their configuration. However, it seems that only generateSW actually leverages this in its code path.

Is this as expected?

If so, then it seems that mode should be removed from the documentation for injectManifest so that users relying on a bundler can make more informed decisions as to what sort of interactions they should have with this API.

If it is not expected, could we get this bundle step added to the workflow so that current tools like rollup-plugin-workbox will perform more in line with what a user might expect?

@jeffposnick
Copy link
Contributor

Thanks for pointing this out—mode is in fact an ignored parameter in workbox-build's injectManifest, and it ended up being listed as supported by mistake due to some aggressive copy-and-pasting.

I'll update the documentation to make that clear, though I don't think we'll cause the usage of mode in injectManifest to fail parameter validation in v5, as that would be a breaking change. It's something we can disallow in v6, and warn about in v5.

As for the other question, I am aware that many Rollup users are looking for something similar to workbox-webpack-plugin's InjectManifest mode, that will handle bundling and precache manifest injection in a single step. As there are now a few third-party solutions to this that use workbox-build "under the hood", I think we're just point folks to those, rather than changing workbox-build's behavior to accommodate this use case.

I'd recommend reaching out to your Workbox Rollup plugin of choice and ask them if they would consider automatically doing the process.env.NODE_ENV replacement. (C.f. chromeos/static-site-scaffold-modules#4)

@jeffposnick jeffposnick self-assigned this Mar 30, 2020
@jeffposnick jeffposnick added Breaking Change Denotes a "major" semver change. Documentation Related to our docs. workbox-build labels Mar 30, 2020
@jeffposnick jeffposnick changed the title Leverage "mode" option in "injectManifest" mode isn't supported by workbox-build's injectManifest Mar 30, 2020
@jeffposnick jeffposnick changed the title mode isn't supported by workbox-build's injectManifest mode isn't supported by workbox-build's injectManifest or getManifest Apr 21, 2020
@kkozlik
Copy link

kkozlik commented May 11, 2020

As the mode is not supported, is there a way to insert non-minified manifest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change Denotes a "major" semver change. Documentation Related to our docs. workbox-build
Projects
None yet
Development

No branches or pull requests

3 participants