diff --git a/package.json b/package.json index 05ce4833f..9e6292eb9 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ ], "scripts": { "start": "concurrently --kill-others \"npm run start-server\" \"npm run start-client\"", - "start-pm2": "yarn pm2-runtime start packages/app/server/lib/index.js", + "start-pm2": "pm2-runtime start --node-args=\"-r dotenv/config\" packages/app/server/lib/index.js -- start", "start-docs": "dumi dev", "bootstrap": "lerna bootstrap", "clean": "rimraf -rf packages/{app,core,plugins}/*/{lib,esm,dist} && lerna clean", diff --git a/packages/core/create-nocobase-app/src/resources/templates/package.json.js b/packages/core/create-nocobase-app/src/resources/templates/package.json.js index adf9576ea..21e6c23d5 100644 --- a/packages/core/create-nocobase-app/src/resources/templates/package.json.js +++ b/packages/core/create-nocobase-app/src/resources/templates/package.json.js @@ -15,7 +15,7 @@ module.exports = (opts) => { 'nocobase-prod': 'cross-env DOTENV_CONFIG_PATH=.env node -r dotenv/config packages/app/server/lib/index.js', 'start-client': 'cd packages/app/client && npm run start', 'start-server': 'npm run nocobase start', - 'start-pm2': 'pm2-runtime start packages/app/server/lib/index.js -- start', + 'start-pm2': 'pm2-runtime start --node-args="-r dotenv/config" packages/app/server/lib/index.js -- start', build: 'lerna run build', 'build-docs': 'dumi build', test: 'node ./jest.cli.js -i',