-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
can't get --pure to further minify/optimize elm generated JS #731
Comments
The |
I see. Closing issue as not supported. |
Curious...
Yet when a regex search/replace was used to inject a
Contrast this to terser with default optimizations and no
and terser with advanced optimizations and no
This size is identical to the final terser command on the unannotated
|
Most tree shaking only works at the top level in esbuild. This is a known limitation. See also #639. The straightforward workaround is to use esbuild to add the outer IIFE wrapper. |
I understand the top level DCE limitation, but don't follow the IIFE wrapper comment. What command do you suggest as a workaround to improve minify size?
|
I now see the IIFE wrapper comment was in relation to #639. |
I'm trying to get a comparable esbuild minified size for the JS in https://evancz.github.io/elm-todomvc/ using instructions adapted from https://guide.elm-lang.org/optimization/asset_size.html:
The original JS:
I can't seem to get esbuild to further optimize code as recommended in the elm optimization guide above:
Is there an option that I'm failing to specify?
For comparison here's the minified size using terser with default optimizations and no pure functions specified:
Here's the minified size using terser with default optimizations and just the first four pure functions listed in the elm optimization instructions:
Minified size using terser with all pure functions listed and other optimizations:
The text was updated successfully, but these errors were encountered: