Webpack elm vs brunch elm && phoenix 1.3 rc 1 --- elixir

Hello, what is recommended to use between webpack and brunch, for implementation of elm in a phoenix elixir project?

You can go with both, it depends on your needs primarily, but if you are familiar with Webpack I’d recommend use it. You’ll just have to install elm-webpack-loader and add elm-rules like this:

module.exports = {
  module: {
    rules: [{
      test: /\.elm$/,
      exclude: [/elm-stuff/, /node_modules/],
      use: {
        loader: 'elm-webpack-loader',
        options: {}
      }
    }]
  }
};

But if you are just playing around and unfamiliar with both Brunch and Webpack, probably Brunch will be easier because you already have some basic setup for it with your Phoenix-generated project. Tutorials are available for both all over the Google.

1 Like

I don’t use either, I just use npm. Why add another build system when you already use npm anyway and it already is a build system. You can see my latest blog from this weekend as an example of how to use NPM as a build system (I use bucklescript instead of elm, but similar procedure anyway). https://blog.overminddl1.com/

2 Likes

yes, there are Many tutorials around the web and I’ve read some of them that do not recommend the use of webpack for compilation because it slows down the work.

It slows down the work if you are new to it - in that case you’ll spend at least a day figuring out how it works and assembling minimal valuable config for your needs. However, based on my experience, Brunch is not much different when it comes to anything more specific than just a few js-files.

Thank you for your advises…