Minify compiled Elm modules!
elm make --optimize <ELM MODULE> doesn't produce particularily small assets on its own. Running
elm-minify on these assets makes them more than 6 times smaller for my examples.
This package aims to provide whatever you need to minify the assets produced by the Elm compiler.
The CLI is distributed through NPM. Here's how it works:
#1 install npm i -g elm-minify #2 compile. "--optimize" is important! elm make --optimize --output=dist/main.js #3 minify to "dist/main.min.js" elm-minify dist/main.js
Parcel doesn't require
elm-minify, as it builds and minifies Elm code out of the box
More optimizations for Elm can be found in the official guide
The CLI allows you to easily minify your Elm binaries. It has a number of flags to modify behavior described using the
If it doesn't fit your needs or something isn't working, let me know with a fresh issue!
This package exposes a node module from it's root. It gives programmatic access to
elm-minify for various purposes described here:
() => Webpack Plugin
elm-minify into Webpack. The plugin will, running in production mode, detect when Webpack is loading files optimized with
elm-webpack-loader, and minify their content before bundling. The overhead of using this compared to the CLI is ~600 bytes for my examples. The Webpack configuration can be found here.
(elmJs : String) => String
Minify compiled elm code synchronously
Get the Terser configuration for mangling and compressing Elm code.