[Node.js] Use "prestart" in scripts

Usually we run : 

npm start

to start an app, then we we might call other script to do something:

npm build && nodemon app

 

Actaully we can use "prestart" to simpify this, because npm will check if there is "prestart" script, if there is it will run prestart before start:

"prestart": "babel src --out-dir dist",
"start": "node dist/index.js"

 

posted @ 2016-03-14 23:58  Zhentiw  阅读(291)  评论(0编辑  收藏  举报