1 安装nodemon
shell
npm install nodemon
2 项目根目录添加配置nodemon.json
主要是利用watch和exec
json
{
"watch": ["assets/**/*.ts", "assets/**/*.js"],
"ext": "ts,js",
"ignore": ["node_modules"],
"exec": "curl http://localhost:7456/asset-db/refresh || echo 'Refresh triggered'"
}
3 启动nodemon
bash
nodemon