Fix rondo frontend (make it use --esm)
This commit is contained in:
parent
8c7b537a99
commit
8aa03e927e
@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
@ -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),
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user