Get updates via , Github, or RSS | About

Episode 39: Elm & Webpack Jun 29, 2017

Webpack is an asset compiling and bundling tool. It works great with Elm thanks to the elm-webpack-loader, and requires very little configuration to get started.

Examples

webpack.config.js

const path = require('path')

module.exports = function(env) {
  return {
    entry: './js/app.js',
    output: {
      path: path.resolve(__dirname, 'dist'),
      filename: 'bundle.js'
    },
    module: {
      loaders: [{
        test: /\.elm$/,
        exclude: [/elm-stuff/, /node_modules/],
        use: {
          loader: 'elm-webpack-loader',
          options: {debug: true, warn: true}
        }
      }]
    }
  }
}