javascript - gulp-nodemon 使用重啟express 服務(wù)器的時(shí)候端口被占用
問(wèn)題描述
// 定義web服務(wù)模塊,增加瀏覽器同步瀏覽gulp.task(’browser-sync’, [’nodemon’], function () { console.log('自動(dòng)自行刷新-------------------------'); browsersync.init(null, { proxy: ’http://localhost:3000’, browser: 'C:Program Files (x86)GoogleChromeApplicationchrome.exe' ,//在谷歌下面打開(kāi) notify: false, port: 3001, files: [dist.root+'**/*'] }); });gulp.task(’nodemon’, function (cb) { var called = false; return nodemon({ script: ’bin/www’ }).on(’start’, function () { if (!called) { cb(); called = true; } });});
怎么使用gulp-nodemon內(nèi)部刪除重新啟動(dòng)express服務(wù)器
問(wèn)題解答
回答1:nodemon本身就可以做到監(jiān)控js文件變化自動(dòng)重啟nodejs服務(wù)。nodemon只需要啟動(dòng)一次即可。
browser-sync任務(wù),不需要nodemon每次都啟動(dòng)。
相關(guān)文章:
1. html - 微信瀏覽器h5<video>標(biāo)簽問(wèn)題2. java - mysql緩存問(wèn)題3. javascript - 關(guān)于Node 、 commonJs、 vue 之間的故事4. node.js - 為什么微信的消息MsgId出現(xiàn)重復(fù)了,無(wú)法排重了。。5. python - 如何對(duì)列表中的列表進(jìn)行頻率統(tǒng)計(jì)?6. python - 如何正則字符串中的所有漢字7. 黑客 - Python模塊安全權(quán)限8. android 微信是如何實(shí)現(xiàn)即時(shí)更新好友頭像的9. android - 像支付寶到位這種點(diǎn)擊marker點(diǎn)擊變大怎么做的10. javascript - 關(guān)于ios微信端瀏覽器網(wǎng)頁(yè)的一些問(wèn)題
