workbox-build: generate minified output?

Created on 15 Oct 2017  路  8Comments  路  Source: GoogleChrome/workbox

Library Affected:
workbox-build, workbox-webpack-plugin

Browser & Platform:
all browsers

Issue or Feature Request Description:
Hello, I would like a way to emit minified output from workbox. I see the libraries already have a minified production version, but it seems there's no option to minify the output from workbox-build.

I'm using the Workbox Webpack plugin specifically, but I believe this option could be useful for the whole ecosystem.

Feature Request Good First Issue workbox-build workbox-webpack-plugin

Most helpful comment

FYI: I'm not suggesting we build minification into workbox-build, just that we should work with a webpack setup that has minification.

All 8 comments

The webpack plugin should fit in with the build pipeline a little better in V3.

@jeffposnick, @goldhand do either of you know if this would be fixed by your changes?

This functionality is not currently in v3. It's worth keeping open to track the request. (And PR contributions are welcome!)

FYI: I'm not suggesting we build minification into workbox-build, just that we should work with a webpack setup that has minification.

should work with a webpack setup that has minification.

馃憤
Currently, my build script does a second Webpack run configured specifically to minify the generated service worker from the first run. Not ideal, but it suffices for the time being.

FYI: I'm not suggesting we build minification into workbox-build, just that we should work with a webpack setup that has minification.

need to check the current code. But in case we're still listening to emit event from webpack, this might need some substantial work

@UltCombo is there any chance you have an example webpack config that should result in minified output?

Any updates on this?

This is now possible via terser starting in the Workbox v5 alphas, when mode: 'production':

https://github.com/GoogleChrome/workbox/blob/cff916d997600489ba48728be9ec33b28f745c6b/packages/workbox-build/src/lib/bundle.js#L50-L59

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeffposnick picture jeffposnick  路  3Comments

alexander-theijs picture alexander-theijs  路  3Comments

truescotian picture truescotian  路  4Comments

kaycebasques picture kaycebasques  路  4Comments

angelinaqj picture angelinaqj  路  4Comments