From 2ea71839d106a7decb055f7ca387c5ffe45211e6 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sat, 29 Oct 2022 23:37:05 +0800 Subject: [PATCH] Add `npm run start-server-watch-dev` for watching server code changes and restart (Node.js 19 only) --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f614480c..2a876f91e 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,9 @@ "dev": "concurrently -k -r \"wait-on tcp:3000 && npm run start-server-dev \" \"npm run start-frontend-dev\"", "start-frontend-dev": "cross-env NODE_ENV=development vite --host --config ./config/vite.config.js", "start": "npm run start-server", - "start-server": "node server/server.js", + "start-server": "node --watch server/server.js", "start-server-dev": "cross-env NODE_ENV=development node server/server.js", + "start-server-watch-dev": "cross-env NODE_ENV=development node --watch server/server.js", "build": "vite build --config ./config/vite.config.js", "test": "node test/prepare-test-server.js && npm run jest-backend", "test-with-build": "npm run build && npm test",