build.js 471 B

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