build.js 573 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env node
  2. var fs = require("fs");
  3. var stitch = require("stitch");
  4. var package = stitch.createPackage({
  5. paths: [__dirname + "/vendor/uglifyjs/lib"]
  6. });
  7. package.compile(function(err, source) {
  8. if (err) throw err;
  9. source = "(function(global) {" +
  10. source + ";\n" +
  11. "global.UglifyJS = {};\n" +
  12. "global.UglifyJS.parser = this.require('parse-js');\n" +
  13. "global.UglifyJS.uglify = this.require('process');\n" +
  14. "}).call({}, this);\n";
  15. fs.writeFile(__dirname + "/lib/uglify.js", source, function(err) {
  16. if (err) throw err;
  17. });
  18. });