GitHub - phenax/esbuild-plugin-elm: An esbuild plugin for building elm projects (original) (raw)
esbuild-plugin-elm
An esbuild plugin for building elm projects
Install
Add this plugin to your project's dev-dependencies by running the following -
yarn add -D esbuild-plugin-elm
// OR
npm install -D esbuild-plugin-elm
Usage
A simple example can be found in ./examples/basic/.
esbuild.build({ entryPoints: ['src/index.js'], bundle: true, outfile: 'dist/bundle.js', plugins: [ ElmPlugin(options) // options are documented below ], }).catch(e => (console.error(e), process.exit(1)))
Import paths
Import paths will be resolved using the paths listed in source-directories
in elm.json
. If none resolve, the import is assumed to be relative to the importing file.
Options
debug
(default:false
):
Enable the time-travelling debuggeroptimize
(default:NODEENV === 'production'
):
Optimize the js output (true by default ifNODE_ENV
is production)pathToElm
(default:nodemodules/.bin/elm || elm
):
Specify an explicit path to the elm executableclearOnWatch
(default:false
):
Clear the console before re-building on file changescwd
(default:<PWD>
):
The current working directory/elm project rootverbose
(default:false
):
Enable verbose output ofnode-elm-compiler