diff --git a/index.mjs b/index.mts similarity index 96% rename from index.mjs rename to index.mts index d902baa75..eb6f50d87 100644 --- a/index.mjs +++ b/index.mts @@ -12,7 +12,7 @@ const ecosystem = await import('./ecosystem.config.js'); if (process.env.ROLE) { // if role variable is set just run that script const app = ecosystem.apps.find((app) => app.name === process.env.ROLE); - import('./' + app.script); + import('./' + app?.script); } else if (process.env.GROUP) { // or run the group with pm2 cp.execSync('pm2 start ecosystem.config.js'); diff --git a/package.json b/package.json index 373244e57..f3b648571 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "22.0.0", "license": "MIT", "scripts": { - "start": "node index.mjs", + "start": "tsx index.mts", "test": "NODE_ENV=test mocha --exit", "build": "npm install && npm run typecheck", "tsc": "tsc --project tsconfig.json",