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]