Reducing output file size

When I make my elm application, my output file size is close to 400k. Is this normal? I have tried the --optimize flag and that drops the size a little.

Are there any good techniques to finding out where the fat is, trimming it, and reducing the file size?

You can reduce the asset size by using elm-minify after --optimize.

Read the Minification section of the guide to understand how it is done or to do it manually.

Intent: Need clarification
Question: How many pages does this app have more or less? That could help us to make a better informed statements.

1 Like

Is 400k after minify and gzip? (for production purposes, all output should be minified and gzipped)

To give you some context, the elm-spa-example compiled has 385kb, if you add --optimize it drops to 370kb if you use elm-minify on the optimized output, the size becomes 93kb and that file gzipped is 30kb.

1 Like

Thanks for all the answers.

elm-minify did a pretty good job!

┌────────┬─────────────────────┬─────────┐
│ source │ rel path │ kb size │
├────────┼─────────────────────┼─────────┤
│ input │ dist/elm.js │ 847.308 │
│ output │ dist/elm.min.js │ 193.96 │
│ gzip │ │ 67.4 │
└────────┴─────────────────────┴─────────┘

Does anyone know how to incorporate elm-minify into webpack?

1 Like

Hi Brendan - I’ve opened an issue regarding Webpack integration, and will do some work to provide guidance, perhaps with an example, but definitely with docs :sunny:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.