replace magic env vars with documented CLI flags

This commit is contained in:
Rich Harris
2018-10-09 08:33:25 -04:00
parent 52f40f9e63
commit 6ae9a5e7c5
4 changed files with 95 additions and 39 deletions

View File

@@ -29,15 +29,20 @@ type URL = url.UrlWithStringQuery;
export { _export as export };
async function _export({
cwd = process.cwd(),
static: static_files = path.join(cwd, 'static'),
build_dir = path.join(cwd, '__sapper__/build'),
cwd,
static: static_files = 'static',
build_dir = '__sapper__/build',
export_dir = '__sapper__/export',
basepath = '',
export_dir = path.join(cwd, '__sapper__/export', basepath),
timeout = 5000,
oninfo = noop,
onfile = noop
}: Opts = {}) {
cwd = path.resolve(cwd);
static_files = path.resolve(cwd, static_files);
build_dir = path.resolve(cwd, build_dir);
export_dir = path.resolve(cwd, export_dir, basepath);
// Prep output directory
sander.rimrafSync(export_dir);