refactor: move startup scripts to shims, add plugins

This commit is contained in:
calebboyd
2017-09-26 20:16:03 -05:00
parent b822984776
commit 11fa087e9d
26 changed files with 2573 additions and 3205 deletions
+4 -2
View File
@@ -33,14 +33,16 @@ function readStreamAsync(stream: NodeJS.ReadableStream): PromiseLike<string> {
*/
export default async function cli(compiler: NexeCompiler, next: () => Promise<void>) {
const { log } = compiler
let stdInUsed = false
if (!process.stdin.isTTY) {
log.step('Using stdin as input')
stdInUsed = true
compiler.input = await readStreamAsync(process.stdin)
}
await next()
log.step(`Bundling: '${stdInUsed ? '[stdin]' : compiler.options.input}'`)
const target = compiler.options.targets.shift() as NexeTarget
const deliverable = await compiler.compileAsync(target)