How to deploy node that uses Gulp to heroku

后端 未结 8 1301
遥遥无期
遥遥无期 2020-12-07 16:21

I\'m using gulp and also gulp plugins like gulp-minify-css, gulp-uglify etc (that listed as npm dependencies for my application).

Also I don\'t commit npm_modules fo

8条回答
  •  甜味超标
    2020-12-07 17:24

    I was able to get this to work by adding this into my "package.json" file:

    "scripts": {
      "start": "node app",
      "postinstall": "gulp default"
    }
    

    The postinstall script is run after the build pack. Check this for more information. The only annoying thing is that all of your dependencies have to live under "dependencies" instead of having separate "devDependencies"

    I didn't need to do anything else with buildpacks or configuration. This seems like the simplest way to do it.

    I wrote about the process I used here

提交回复
热议问题