From 34f3ddc26a721c66ad8e3bdcb91d351592e3bd02 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Tue, 13 Mar 2018 15:10:32 -0500 Subject: [PATCH] fix: bootstrap file path in node 4.x --- src/patches/third-party-main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/patches/third-party-main.ts b/src/patches/third-party-main.ts index 65d0329..5b8faa1 100644 --- a/src/patches/third-party-main.ts +++ b/src/patches/third-party-main.ts @@ -4,7 +4,9 @@ import { join } from 'path' import { wrap } from '../util' export default async function main(compiler: NexeCompiler, next: () => Promise) { - const file = await compiler.readFileAsync('lib/internal/bootstrap_node.js') + const bootPath = + (compiler.target.version.startsWith('4') ? 'src/' : 'lib/internal/bootstrap_') + 'node.js' + const file = await compiler.readFileAsync(bootPath) const parts = file.contents.split('function(process) {') file.contents = parts[0] + `function(process) {` + '{{replace:lib/patches/bootstrap.js}}' + parts[1]