All Downloads are FREE. Search and download functionalities are using the official Maven repository.

node_modules.source-map-support.build.js Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
#!/usr/bin/env node

var fs = require('fs');
var path = require('path');
var querystring = require('querystring');
var child_process = require('child_process');

var browserify = path.resolve(path.join('node_modules', '.bin', 'browserify'));
var webpack = path.resolve(path.join('node_modules', '.bin', 'webpack'));
var coffee = path.resolve(path.join('node_modules', '.bin', 'coffee'));

function run(command, callback) {
  console.log(command);
  child_process.exec(command, callback);
}

// Use browserify to package up source-map-support.js
fs.writeFileSync('.temp.js', 'sourceMapSupport = require("./source-map-support");');
run(browserify + ' .temp.js', function(error, stdout) {
  if (error) throw error;

  // Wrap the code so it works both as a normal