main.js 645 B

123456789101112131415161718192021222324252627
  1. import "./lib/transform.js";
  2. import "./lib/mozilla-ast.js";
  3. import { minify } from "./lib/minify.js";
  4. export { minify, minify_sync } from "./lib/minify.js";
  5. export { run_cli as _run_cli } from "./lib/cli.js";
  6. export async function _default_options() {
  7. const defs = {};
  8. Object.keys(infer_options({ 0: 0 })).forEach((component) => {
  9. const options = infer_options({
  10. [component]: {0: 0}
  11. });
  12. if (options) defs[component] = options;
  13. });
  14. return defs;
  15. }
  16. async function infer_options(options) {
  17. try {
  18. await minify("", options);
  19. } catch (error) {
  20. return error.defs;
  21. }
  22. }