From 37a9fb62e23a281d24b5f160313de4923e1a27ea Mon Sep 17 00:00:00 2001 From: John Muhl Date: Sun, 22 Apr 2018 20:29:47 -0500 Subject: [PATCH] Include process.env in exporter server options --- src/cli/export.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/export.ts b/src/cli/export.ts index 9618c70..99eee4c 100644 --- a/src/cli/export.ts +++ b/src/cli/export.ts @@ -35,12 +35,12 @@ export async function exporter(export_dir: string, { basepath = '' }) { const proc = child_process.fork(path.resolve(`${build_dir}/server.js`), [], { cwd: process.cwd(), - env: { + env: Object.assign({}, process.env, { PORT: port, NODE_ENV: 'production', SAPPER_DEST: build_dir, SAPPER_EXPORT: 'true' - } + }) }); const seen = new Set(); @@ -103,4 +103,4 @@ export async function exporter(export_dir: string, { basepath = '' }) { return ports.wait(port) .then(() => handle(new URL(`/${basepath}`, origin))) // TODO all static routes .then(() => proc.kill()); -} \ No newline at end of file +}