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

minify + compression improvement ? #704

Closed
kapouer opened this issue Mar 6, 2020 · 3 comments · Fixed by #1978
Closed

minify + compression improvement ? #704

kapouer opened this issue Mar 6, 2020 · 3 comments · Fixed by #1978
Labels
Milestone

Comments

@kapouer
Copy link

kapouer commented Mar 6, 2020

I understand the idea that gzip should do the heavy lifting of compressing js files.
However the end result is still kind of "too heavy":

  • concatenated bundle: > 500ko
  • uglified and gzipped: 73ko
  • uglified and brotli: 61ko
  • swc+minify and gzipped: 130ko
  • swc+minify and brotli: 100ko

I suppose it's not a high priority to improve on this, hence the request ;)

@kapouer kapouer changed the title minify produces too big code even after compression minify + compression improvement ? Mar 6, 2020
@kdy1
Copy link
Member

kdy1 commented Mar 7, 2020

Currently swc does not do anything smart to minify bundle.
I'm busy working on a type inference engine to generate .d.ts files and I'll write a bundler and optimizer after it.

@kdy1
Copy link
Member

kdy1 commented May 20, 2021

I'll close this when I add the javascript apis.
Currently the minifier is beta (in rust side) and there's no js apis.

@kdy1 kdy1 added this to the v1.2.67 milestone Jul 31, 2021
kdy1 added a commit that referenced this issue Jul 31, 2021
swc_ecma_codegen:
 - Fix codegen of imports when minification is enabled.

swc_ecma_minifier:
 - Mangle identifiers used by imports.

swc:
 - Support specifing `jsc.minify`. (#704, #1371)

swc/node:
 - Add `.minify()`.
 - Add `.minifySync()`.

swc/wasm:
 - Add `.minifySync()`.
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 23, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants