Should I move from brunch to webpack?

It is not too complicated, You just need to adjust webpack.config.js like this…

  entry: {
    bundle: SRC_PATH + '/js/index',
  },

And index.js like this

import '../css/app.css';

Then You could add js and css subfolders inside src folder :slight_smile:

2 Likes

One tiny quirk I noticed is that ending an iex session doesn’t end the node process. so after doing that a couple times I realized I had several instances running that I have to manually kill.

Any thoughts around having phoenix end the process?

Maybe you’re missing the correct flag for webpack: https://github.com/phoenixframework/phoenix/commit/89cdcfbaa041da1daba39e39b0828f6a28b6d52f

2 Likes

Config might have changed (again…). Following @LostKobrakai link. You might need to change package.json the watcher like this., if you have the latest Phoenix.

"watch": "webpack --watch-stdin --mode development",
1 Like

That did the trick. Thanks a bunch :pray:

I followed this guide https://gist.github.com/chrismccord/bb1f8b136f5a9e4abc0bfc07b832257e to move from brunch with webpack and it works fine but it doesn’t work fine in Heroku.

I initially followed https://hexdocs.pm/phoenix/heroku.html#adding-the-phoenix-static-buildpack to deploy on Heroku with brunch + sass but it doesn’t work well with webpack.

Has anyone run into issues with this? Maybe a differerent Heroku buildpack is needed to work with webpack + sass?