Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phenax/esbuild-plugin-elm
An esbuild plugin for building elm projects
https://github.com/phenax/esbuild-plugin-elm
Last synced: about 2 months ago
JSON representation
An esbuild plugin for building elm projects
- Host: GitHub
- URL: https://github.com/phenax/esbuild-plugin-elm
- Owner: phenax
- License: mit
- Created: 2021-02-24T18:42:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-22T13:08:50.000Z (about 1 year ago)
- Last Synced: 2024-07-19T21:14:34.581Z (2 months ago)
- Language: JavaScript
- Size: 95.7 KB
- Stars: 28
- Watchers: 3
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# esbuild-plugin-elm
An esbuild plugin for building elm projects[![npm](https://img.shields.io/npm/v/esbuild-plugin-elm?color=%2351e980&style=flat-square)](https://www.npmjs.com/package/esbuild-plugin-elm)
### 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/](https://github.com/phenax/esbuild-plugin-elm/tree/main/examples/basic).
```js
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 debugger
* `optimize` *(default: `NODE_ENV === 'production'`)*:
Optimize the js output (true by default if `NODE_ENV` is production)
* `pathToElm` *(default: `node_modules/.bin/elm || elm`)*:
Specify an explicit path to the elm executable
* `clearOnWatch` *(default: `false`)*:
Clear the console before re-building on file changes
* `cwd` *(default: ``)*:
The current working directory/elm project root
* `verbose` *(default: `false`)*:
Enable verbose output of `node-elm-compiler`
### Tutorials
* [How to Install Elm, on a Rails App, via esbuild, using `esbuild-plugin-elm`](https://benkoshy.github.io/2022/02/08/elm-via-esbuild-on-rails.html)