diff --git a/src/patches/index.ts b/src/patches/index.ts index 9d4ad5c..8697313 100644 --- a/src/patches/index.ts +++ b/src/patches/index.ts @@ -5,7 +5,8 @@ import cli from './disable-node-cli' import flags from './flags' import ico from './ico' import rc from './node-rc' +import snapshot from './snapshot' -const patches = [gyp, bootNexe, buildFixes, cli, flags, ico, rc] +const patches = [gyp, bootNexe, buildFixes, cli, flags, ico, rc, snapshot] export default patches diff --git a/src/patches/snapshot.ts b/src/patches/snapshot.ts index fabe1b6..f3f1c7d 100644 --- a/src/patches/snapshot.ts +++ b/src/patches/snapshot.ts @@ -1,3 +1,4 @@ +import * as path from 'path' import { NexeCompiler } from '../compiler' export default async function snapshot(compiler: NexeCompiler, next: () => Promise) { @@ -11,8 +12,8 @@ export default async function snapshot(compiler: NexeCompiler, next: () => Promi await compiler.replaceInFileAsync( 'configure', 'def configure_v8(o):', - `def configure_v8(o):\n o['variables']['embed_script'] = '${snapshotFile}'\n o['variables']['warmup_script'] = '${warmupScript || - snapshotFile}'` + `def configure_v8(o):\n o['variables']['embed_script'] = r'${path.resolve(snapshotFile)}'\n o['variables']['warmup_script'] = r'${path.resolve(warmupScript || + snapshotFile)}'` ) return next()