A CLI tool (v0.3.5) that applies a second level of optimization to the JavaScript output of the Elm compiler, producing faster code while maintaining Elm semantics. It can be used as a drop-in replacement for `elm make --optimize` and supports an `--optimize-speed` flag for even faster code at the cost of ~5% larger bundle size. The project is experimental and may introduce breaking changes. Key differentiators: Elm-specific JS transformations (e.g., tweaking record updates), active development with community benchmarks, and no built-in minification.
npm install elm-optimize-level-2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows installation, CLI usage with output filename and --optimize-speed flag, and programmatic compilation using ESM import with TypeScript.
Use a separate tool (e.g., elm-live) or serve the JS file with an HTML host.
Do not use `--optimize-speed` if bundle size is a constraint.
Only use in production after thorough testing.
Use a minifier like Terser and gzip before deploying.
Set `"type": "module"` in your package.json or use `.mjs` extension.
Use `import` or set "type": "module" in package.json.
Install globally: `npm install -g elm-optimize-level-2` or use `npx elm-optimize-level-2`.
Check documentation or README; run without arguments to see usage (if supported).