A simple Webpack loader for Elm sources. Uses your system Elm installation.
Add elm-simple-loader to your loaders:
loaders: [
{
loader: 'elm-simple-loader',
test: /\.elm$/,
exclude: /node_modules/
}
]
And then in your JS...
import Elm from '../elm/App.elm';
Elm.fullscreen(Elm.App); and whatnot
Enjoy!
When you bring in precompiled files (like if elm.js
contains bits that
have been built by elm-make
), you'll end up getting warnings about how
you're using precompiled files. To shut this error up, you can add this
to your module
config:
[...]
module: {
loaders: [...],
noParse: [/.elm$/] // tells webpack to not parse Elm sources
}
[...]