diff --git a/packages/worker/package.json b/packages/worker/package.json index 3da93bab2e..3c94b50555 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -16,8 +16,8 @@ "build": "cd ../.. && nx build @budibase/worker", "check:types": "tsc -p tsconfig.build.json --noEmit", "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput", - "run:docker": "node dist/index.cjs", - "debug": "yarn build && node --expose-gc --inspect=9223 dist/index.cjs", + "run:docker": "node dist/index.js", + "debug": "yarn build && node --expose-gc --inspect=9223 dist/index.js", "run:docker:cluster": "pm2-runtime start pm2.config.js", "predocker": "yarn build", "build:docker": "yarn predocker && docker build . -t worker-service --label version=$BUDIBASE_RELEASE_VERSION", diff --git a/packages/worker/pm2.config.js b/packages/worker/pm2.config.js index d7b0ea1576..b5fb1880ef 100644 --- a/packages/worker/pm2.config.js +++ b/packages/worker/pm2.config.js @@ -1,7 +1,7 @@ module.exports = { apps: [ { - script: "./dist/index.cjs", + script: "./dist/index.js", instances: "max", exec_mode: "cluster", }, diff --git a/packages/worker/project.json b/packages/worker/project.json index e86909871e..fd200ceb7a 100644 --- a/packages/worker/project.json +++ b/packages/worker/project.json @@ -5,7 +5,6 @@ "build": { "executor": "@nx/esbuild:esbuild", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "packages/worker/src/index.ts", "outputPath": "packages/worker/dist", @@ -18,7 +17,12 @@ "output": "." } ], - "format": ["cjs"] + "format": ["cjs"], + "esbuildOptions": { + "outExtension": { + ".js": ".js" + } + } }, "configurations": { "development": {