Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/0918nobita/rollup-plugin-elm2

Bundle Elm programs with Rollup
https://github.com/0918nobita/rollup-plugin-elm2

elm rollup rollup-plugin

Last synced: 3 months ago
JSON representation

Bundle Elm programs with Rollup

Awesome Lists containing this project

README

        

# rollup-plugin-elm2

Bundle Elm programs with Rollup

Supported Elm version: 0.19

## Usage

```javascript
import Elm from './Main.Elm';

const node = document.getElementById('app');
const app = Elm.Main.init({ node });
```

### rollup.config.js

```javascript
import elm from 'rollup-plugin-elm2';

const production = !process.env.ROLLUP_WATCH;

export default {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'es',
},
plugins: [
elm({
exclude: 'elm-stuff/**',
compiler: {
optimize: production,
debug: !production,
},
}),
],
};
```

Check the `/example` for a complete example.

## Options

```javascript
{
include: [],
exclude: [],
compiler: {
// Enable / Disable compiler optimizations (default: false)
optimize: true,
// Enable / Disable debug mode (default: false)
debug: false,
// Path to Elm executable (default: elm)
pathToElm: path.resolve(__dirname, 'node_modules/elm/bin/elm')
}
}
```