build.js 455 B

12345678910111213
  1. var bundle = require('browserify')(),
  2. fs = require('fs'),
  3. request = require('request'),
  4. uglify = require('uglify-js');
  5. bundle.add('./simplewebrtc');
  6. bundle.bundle({standalone: 'SimpleWebRTC'}, function (err, source) {
  7. if (err) console.error(err);
  8. fs.writeFileSync('simplewebrtc.bundle.js', source);
  9. fs.writeFile('latest.js', uglify.minify(source, {fromString: true}).code, function (err) {
  10. if (err) throw err;
  11. });
  12. });