diff --git a/package.json b/package.json index 6bd2a7e..667e5bf 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nexe", "description": "Create a single executable out of your Node.js application", "license": "MIT", - "version": "2.0.0-rc.12", + "version": "2.0.0-rc.13", "contributors": [ "Craig Condon (http://crcn.io)", "Jared Allard ", diff --git a/src/steps/shim.ts b/src/steps/shim.ts index ab2012e..86cbe8f 100644 --- a/src/steps/shim.ts +++ b/src/steps/shim.ts @@ -7,6 +7,16 @@ function wrap(code: string) { export default function(compiler: NexeCompiler, next: () => Promise) { compiler.shims.push(wrap(compiler.getHeader())) + compiler.shims.push( + wrap(` + if (process.argv[1] && process.env.NODE_UNIQUE_ID) { + const cluster = require('cluster') + cluster._setupWorker() + delete process.env.NODE_UNIQUE_ID + } + `) + ) + if (compiler.options.resources.length) { compiler.shims.push(wrap('{{replace:lib/steps/shim-fs.js}}')) }