mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-20 06:15:15 +00:00
Merge pull request #245 from johnmuhl/patch-1
Include process.env in exporter server options
This commit is contained in:
@@ -35,12 +35,12 @@ export async function exporter(export_dir: string, { basepath = '' }) {
|
|||||||
|
|
||||||
const proc = child_process.fork(path.resolve(`${build_dir}/server.js`), [], {
|
const proc = child_process.fork(path.resolve(`${build_dir}/server.js`), [], {
|
||||||
cwd: process.cwd(),
|
cwd: process.cwd(),
|
||||||
env: {
|
env: Object.assign({
|
||||||
PORT: port,
|
PORT: port,
|
||||||
NODE_ENV: 'production',
|
NODE_ENV: 'production',
|
||||||
SAPPER_DEST: build_dir,
|
SAPPER_DEST: build_dir,
|
||||||
SAPPER_EXPORT: 'true'
|
SAPPER_EXPORT: 'true'
|
||||||
}
|
}, process.env)
|
||||||
});
|
});
|
||||||
|
|
||||||
const seen = new Set();
|
const seen = new Set();
|
||||||
@@ -103,4 +103,4 @@ export async function exporter(export_dir: string, { basepath = '' }) {
|
|||||||
return ports.wait(port)
|
return ports.wait(port)
|
||||||
.then(() => handle(new URL(`/${basepath}`, origin))) // TODO all static routes
|
.then(() => handle(new URL(`/${basepath}`, origin))) // TODO all static routes
|
||||||
.then(() => proc.kill());
|
.then(() => proc.kill());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user