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.