refactor: move startup scripts to shims, add plugins
This commit is contained in:
+4
-2
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user