Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy node that uses Webpack to heroku

I'm using webpack.

Also I don't commit npm_modules folder and public folder, where all generated files are. And I can't figure out how to build my app (I have webpack build command) after deploy and setup my server (it's already looking for public folder).

It seems me a bad idea to commit before upload. Maybe there are some gentle decisions... Any thoughts?

Forked from: How to deploy node that uses Gulp to heroku

like image 227
Inanc Gumus Avatar asked Mar 25 '16 15:03

Inanc Gumus


1 Answers

"heroku-postbuild": "webpack -p --config ./webpack.prod.config.js --progress" 

this is better because if you use postinstall, everytime you do npm i the build script get fired

like image 180
Gaurav Mukherjee Avatar answered Sep 19 '22 20:09

Gaurav Mukherjee