export should fail on timeouts

This commit is contained in:
Rich Harris
2018-08-24 14:25:48 -04:00
parent 62b8a79e9f
commit 8abc01551e
3 changed files with 53 additions and 25 deletions

View File

@@ -8,13 +8,20 @@ function left_pad(str: string, len: number) {
return str;
}
export function exporter(export_dir: string, { basepath = '' }) {
export function exporter(export_dir: string, {
basepath = '',
timeout
}: {
basepath: string,
timeout: number | false
}) {
return new Promise((fulfil, reject) => {
try {
const emitter = _exporter({
build: locations.dest(),
dest: export_dir,
basepath
basepath,
timeout
});
emitter.on('file', event => {