Webpack loader for the Elm programming language.
$ npm install --save elm-webpack-loaderIn your webpack.config.js file:
module.exports = {
module: {
loaders: [{
test: /\.elm$/,
exclude: [/elm-stuff/, /node_modules/],
loader: 'elm-webpack'
}]
}
};You can add cache=true to the loader:
...
loader: 'elm-webpack?cache=true'
...If you add this, when using npm run watch, the loader will only load the
dependencies at startup. This could be performance improvement, but know that
new files won't be picked up and so won't be watched until you restart webpack.
This flag doesn't matter if you don't use watch mode.
You can find an example in the example folder.
To run:
npm install
npm run build
You can have webpack watch for changes with: npm run watch
You can run the webpack dev server with: npm run dev
Webpack can complain about precompiled files (files compiled by elm-make).
You can silence this warning with noParse. You can see it in use in the example.
module: {
loaders: [...],
noParse: [/.elm$/]
}