This leads me to believe we’re not doing things the right way.
I think what needs to happen is I need to remove the end result
app.js file from my Git repository, and only keep the source JS files in the repo.
The assets should probably be built on-deploy to Heroku as well.
Does anyone have experience with Phoenix/Webpack for this problem?
Yes, don’t put your compiled app.js into your repo.
Can you recommend a guide or article on how to compile Webpack assets on deploy for a Phoenix app?
There are many ways to accomplish this, it really depends on where you are deploying as well.
Maybe some more background on your current deployment system would help.
You could use Docker for example, or a PaaS solution.
I’m hosting it on a Heroku free-tier dyno with the Elixir Heroku buildpack:
The project is using Webpack 3, and basically right now it compiled everything down into a single app.js file located in:
So right now I have this compiled app.js in the code repository, but I want to remove it and compile it on deploy so the JS is compiled on the Heroku side.
Appreciate the help!