From 8aa03e927ec8cb0efae4ebdbf9f61332166bb055 Mon Sep 17 00:00:00 2001 From: Jerko Steiner Date: Fri, 1 Nov 2019 13:12:04 -0400 Subject: [PATCH] Fix rondo frontend (make it use --esm) --- packages/scripts/src/Subprocess.ts | 11 ++++++----- packages/scripts/src/scripts/build.ts | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/scripts/src/Subprocess.ts b/packages/scripts/src/Subprocess.ts index cd9a383..fc3d450 100644 --- a/packages/scripts/src/Subprocess.ts +++ b/packages/scripts/src/Subprocess.ts @@ -21,10 +21,11 @@ export class Subprocess { } async run(cwd?: string) { - const {i} = this + const {command, i} = this + const index = `${i}:${command}` return new Promise((resolve, reject) => { - process.stderr.write(`[${i}]: ${this.command} ${this.args.join(' ')}\n`) - const subprocess = spawn(this.command, this.args, { + process.stderr.write(`${index} ${this.args.join(' ')}\n`) + const subprocess = spawn(command, this.args, { shell: false, stdio: this.stdio, env: this.environment, @@ -33,11 +34,11 @@ export class Subprocess { if (this.stdio === StdioOptions.PIPE) { subprocess.stdout!.on('data', data => { - process.stdout.write(`${i}> `) + process.stdout.write(`${index}> `) process.stdout.write(data) }) subprocess.stderr!.on('data', data => { - process.stdout.write(`${i}> `) + process.stdout.write(`${index}> `) process.stderr.write(data) }) } diff --git a/packages/scripts/src/scripts/build.ts b/packages/scripts/src/scripts/build.ts index 595791e..0704e36 100644 --- a/packages/scripts/src/scripts/build.ts +++ b/packages/scripts/src/scripts/build.ts @@ -142,7 +142,7 @@ export async function js(...argv: string[]) { js.help = 'Build or watch client-side js files' async function buildJs(path: string) { - await build(...['-p', path, '--esm']) + await build(...[path, '--esm']) await browserify(path) await uglify(path) } @@ -212,9 +212,9 @@ export async function frontend(...argv: string[]) { if (args['full-paths']) { watchArgs.push('--full-paths') } - await build(...['-p', path]) + await build(argv[0], ...['--esm', path]) const promises = [ - build(...['-p', path, '--watch']), + build(argv[0], ...['--esm', path, '--watch']), watchJs(path, ...watchArgs), watchCss(path), ]