2.0.4 • Published 5 years ago

elm-minify v2.0.4

Weekly downloads
258
License
BSD-3-Clause
Repository
github
Last release
5 years ago

Elm Minify

Minify compiled Elm modules!

version build

npm.io

Running 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.

Get Started

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

CLI

The CLI allows you to easily minify your Elm binaries. It has a number of flags to modify behavior described using the --help flag:

elm-minify --help

If it doesn't fit your needs or something isn't working, let me know with a fresh issue!

Node.js API

This package exposes a node module from it's root. It gives programmatic access to elm-minify for various purposes described here:

WebpackPlugin

() => Webpack Plugin

Plug 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.

minify

(elmJs : String) => String

Minify compiled elm code synchronously

terserConfig

Terser Configuration

Get the Terser configuration for mangling and compressing Elm code.

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

6 years ago

1.5.3

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago