Tool to deploy only dist folder of NodeJS project to Heroku.
$ npm install -g dist-only
Run
dist-only --init
or add manually dist-only-run
and dist-only-app
commands to scripts
section of your package.json
"scripts": {
"dist-only-app": "echo \"$YOUR_HEROKU_APP_NAME\""
"dist-only-run": "node server.bundle.js"
...
}
Without publishing
$ npm run dist-only
With publishing
$ npm run dist-only --deploy
Keep in mind that you have to store your development files not in the same repo as you specified for dist-only deployment.
dist-only
requires Heroku CLI to be installed on your machine.
- it copies all content of your
dist
folder intodist-only
folder - it copies your
package.json
w/odevDependencies
section and replacesrun
script withdist-only-run
- it copies your
Procfile
todist-only
folder - it keeps
.git
indist-only
folder related to your Heroku app - it deploys
dist-only
folder to Heroku
MIT