Closed azamat-sharapov closed 3 years ago
That's a good point, would you mind to create a PR for it? We use https://www.npmjs.com/package/rollup-plugin-workbox underhood and I guess there should be an option for that (we can make it default to minified and configurable for users to opt-out). Thanks
It turns out generateSW()
already minifies output, if mode
options is set to "production"
. The problem is when building, tsup
replaces process.env
variables, so mode
option always set to "development"
. Quick fix for this is to pass mode: process.env.NODE_ENV
via workbox
option to VitePWA
. Ideally though, tsup
should not touch process.env.NODE_ENV
piece.
Service worker and Workbox javascript files are not minified. Is there any option I should add or is it missing this feature?