Closed moldybeats closed 5 years ago
I added the nodejs buildpack to our Heroku app (in addition to the ruby buildpack). I think this is what we need in order to run webpack on deployment. Our package.json
file already contains a scripts
key with some webpack commands. I'm guessing these commands worked at one point in a previous deployment of the app, so I'm going to leave them in place for now and see what happens on our next deployment. If they don't work, we may need to tweak those commands.
webpack
is running on each Heroku deployment now, but I think we may have to fiddle with the settings to find the command for a production build. I'm not sure app_bundle.js
is really compressed like it should be.
On each Heroku deployment, the webpack -p
command runs now to create a production-ready version of app_bundle.js
.
Deploying the app to Heroku does not currently trigger a build of the app_bundle.js file. This means that changes to *.jsx files won't appear in Production unless we build app_bundle.js locally and commit those changes. It would be much cleaner if we could rebuild the client-side code automatically on the server after each deployment.
I think we want to use Heroku's "release phase" hooks for this: https://devcenter.heroku.com/articles/release-phase