Please help, how configure pm2 with watcher changes files and restart after crush?
Old config used nodemon.
package.json
{
"name": "test-server",
"version": "0.0.1",
"description": "test server",
"main": "index.js",
"scripts": {
"start": "nodemon -L --exec ts-node src/index.ts",
"build-ts": "tsc",
"postinstall": "npm run build-ts"
},
"engines": {
"node": "8.9.1"
},
"author": "test",
"license": "ISC",
"dependencies": {
"express-basic-auth": "^1.1.6",
"@colyseus/monitor": "^0.1.11",
"colyseus": "^0.9.28",
"cors": "^2.8.5",
"express": "^4.16.4",
"nodemon": "^1.18.9"
},
"devDependencies": {
"@types/express": "^4.16.0",
"@types/node": "^10.12.18",
"ts-node": "^8.0.1",
"typescript": "^3.2.4"
}
}
tsconfig.json
{
"compilerOptions": {
"outDir": "lib",
"module": "commonjs",
"lib": ["es6"],
"target": "es2016",
"declaration": true,
"noImplicitAny": false,
"experimentalDecorators": true,
"sourceMap": true,
},
"include": [
"**/*.ts"
]
}
Thanks for help