UNPKG

microbundle

Version:

Zero-configuration bundler for tiny JS libs, powered by Rollup.

22 lines (18 loc) 463 B
#!/usr/bin/env node import microbundle from './index'; import prog from './prog'; import { stdout } from './utils'; import logError from './log-error'; const run = opts => { microbundle(opts) .then(({ output }) => { if (output != null) stdout(output); if (!opts.watch) process.exit(0); }) .catch(err => { process.exitCode = (typeof err.code === 'number' && err.code) || 1; logError(err); process.exit(); }); }; prog(run)(process.argv);