UNPKG

muddler

Version:

A minifier for hackmud scripts

20 lines (14 loc) 550 B
import { muddleStr, getOutFilename } from './utils'; import { transpile } from './transpile'; import { test } from './testing' import { compile } from './closure' export async function processFile(program, filename) { if (!program.quiet) console.log(muddleStr('Muddling'), filename); const basename = getOutFilename(program, filename); transpile(program, filename) const failed = await test(program, filename, basename) if (failed <= 0) { await compile(program, filename, basename) } }