-
Add to
.gitignore
:node_modules public
-
Add to your app
dependencies
ofpackage.json
:"statik": ">= 1.1.0", "brunch": "1.x",
-
Create
server.js
:var statik = require('statik'); statik(process.env.PORT || 1337);
-
Add Procfile.
web: node server.js
-
Add to
scripts
section ofpackage.json
:"postinstall": "brunch build --optimize"
-
Deploy, PROFIT!
Last active
March 29, 2019 23:12
-
-
Save paulmillr/3596447 to your computer and use it in GitHub Desktop.
Build & deploy brunch applications on Heroku.
Here's how I go about it:
I couldn't get this to work on heroku, ended up using Koa and for things and needed a multipack for having ruby there to install sass gem (since I was using it in my project)
"postinstall": "brunch build --optimize"
has changed to
"postinstall": "brunch build --production",
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had a couple of issues with this recently using the AngularJS seed (not sure about others). First is Heroku's expectations for Node and NPM require this:
Second the public folder was named
_public
for some reason now so you'll need to startstatic.createServer('_public')
now obviously. Hope that's helpful.