admin管理员组文章数量:1290980
Is there any boiler plate code to use pm2
with webpack
watch option for ts files auto hot reload?
pm2 start index.js
is helpful to run directly, but how to add multiple tasks before doing it like watch files and auto reload using webpack and pm2 from dist folders?
Is there any boiler plate code to use pm2
with webpack
watch option for ts files auto hot reload?
pm2 start index.js
is helpful to run directly, but how to add multiple tasks before doing it like watch files and auto reload using webpack and pm2 from dist folders?
- why do you need pm2 in your case? Webpack already has some watch options. Is it just for when it crashes? – David Commented Apr 5, 2018 at 15:25
- 1 pm2 has more benefits pared to webpack. Hence bination of both is worth – Mithun Shreevatsa Commented Apr 6, 2018 at 16:26
2 Answers
Reset to default 7After much research considering performance, I might add live reload, which is a to-do task – but not a priority as of now.
"scripts": {
"build": "webpack --config webpack.config.js --watch",
"pm2": "pm2 start ./dist/server.js --watch=true",
"postinstall": "npm run build",
"test": "jest --forceExit",
"test-ci": "npm test && cat ./coverage/lcov.info | coveralls",
"start": "supervisor ./dist/server.js",
"server:dev": "concurrently \"npm run build \" \"npm run start\""
}
Create a process.json for pm2 config In the script key you can give a webpack piler to run. I am not sure if it will run for it watch reload.
本文标签: javascriptHow to configure pm2 with webpack for typescripts compile and reloadStack Overflow
版权声明:本文标题:javascript - How to configure pm2 with webpack for typescripts compile and reload? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741518569a2383042.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论