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

Minified output #8

Closed
azamat-sharapov opened this issue Dec 25, 2020 · 2 comments · Fixed by #9
Closed

Minified output #8

azamat-sharapov opened this issue Dec 25, 2020 · 2 comments · Fixed by #9
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@azamat-sharapov
Copy link
Contributor

Service worker and Workbox javascript files are not minified. Is there any option I should add or is it missing this feature?

@antfu
Copy link
Member

antfu commented Dec 26, 2020

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

@antfu antfu added enhancement New feature or request help wanted Extra attention is needed labels Dec 26, 2020
@azamat-sharapov
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants