admin管理员组文章数量:1395436
I'm doing small programming challenges locally.
In one tab I draft a solution, let's call it challenge.js
and in another tab I run the mand node challenge.js
whenever I make a change.
Is there a way for node to pile automatically whenever a change has been made to challenge.js
?
I'm doing small programming challenges locally.
In one tab I draft a solution, let's call it challenge.js
and in another tab I run the mand node challenge.js
whenever I make a change.
Is there a way for node to pile automatically whenever a change has been made to challenge.js
?
- 1 this will help stackoverflow./questions/1972242/… – Badr Commented Nov 1, 2016 at 14:41
- nodemon did the job, thanks – timothyylim Commented Nov 1, 2016 at 14:44
3 Answers
Reset to default 9The first ment answered the question.
I installed nodemon:
$ npm install nodemon -g
$ nodemon app.js
and it works perfectly.
This is for development environment? If yes, you can use a build tool like webpack, gulp, etc.
Webpack provides a tool webpack-dev-server, that repile your bundle at every change.
I hope to have helped.
Use nodemon. https://www.npmjs./package/nodemon I work in server development and it refershes the server every time I save a file. If its a case you want something live to restart every time it crashes or if theres any change use pm2 https://www.npmjs./package/pm2
本文标签: javascriptNode compile on file changeStack Overflow
版权声明:本文标题:javascript - Node compile on file change - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744112030a2591334.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论