Fix rondo frontend (make it use --esm)

This commit is contained in:
Jerko Steiner 2019-11-01 13:12:04 -04:00
parent 8c7b537a99
commit 8aa03e927e
2 changed files with 9 additions and 8 deletions

View File

@ -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)
})
}

View File

@ -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),
]