rollup-plugin-elm

3.0.0 • Public • Published

rollup-plugin-elm

Import .elm (Elm 0.19) files as ES6 modules.

Usage

import Elm from './App.elm'

const root = document.getElementById('app')
const app = Elm.App.init({ node: root })

rollup.config.js

import elm from 'rollup-plugin-elm'

export default {
  input: 'src/index.js',
  output: {
    file: `dist/bundle.js`,
    format: 'iife'
  },
  plugins: [
    elm({
      exclude: 'elm_stuff/**'
    })
  ]
}

Check the examples/ folder for a complete example.

Options

{
  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')
  }
}

Elm 0.18

Elm 0.18 is supported up to version 1.0.6 of this package. It can installed by running:

npm install --save-dev rollup-plugin-elm@1.0.6

Package Sidebar

Install

npm i rollup-plugin-elm

Weekly Downloads

5

Version

3.0.0

License

MIT

Unpacked Size

7.42 kB

Total Files

6

Last publish

Collaborators

  • ulisses-alves