Socket
Socket
Sign inDemoInstall

webpack

Package Overview
Dependencies
Maintainers
1
Versions
837
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

test/browsertest/node_modules/libary2/node_modules/submodule1/index.js

133

bin/webpack.js

@@ -156,83 +156,68 @@ #!/usr/bin/env node

if(!output) {
// DEPRECATED
webpack(input, options, function(err, source) {
if(err) {
console.error(err);
return;
}
if(output) {
fs.writeFileSync(output, source, "utf-8");
} else {
process.stdout.write(source);
}
});
} else {
output = output || path.join(process.cwd(), "js", "web.js");
if(!options.outputDirectory) options.outputDirectory = path.dirname(output);
if(!options.output) options.output = path.basename(output);
if(!options.outputPostfix) options.outputPostfix = "." + path.basename(output);
if(!options.context) options.context = process.cwd();
output = output || path.join(process.cwd(), "js", "web.js");
if(!options.outputDirectory) options.outputDirectory = path.dirname(output);
if(!options.output) options.output = path.basename(output);
if(!options.outputPostfix) options.outputPostfix = "." + path.basename(output);
if(!options.context) options.context = process.cwd();
// some listeners for the progress display
if(argv.progress) {
if(!options.events) options.events = new (require("events").EventEmitter)();
var events = options.events;
// some listeners for the progress display
if(argv.progress) {
if(!options.events) options.events = new (require("events").EventEmitter)();
var events = options.events;
var sum = 0;
var finished = 0;
var chars = 0;
function print() {
var msg = "";
if(sum > 0) {
msg += "compiling... (" + c("\033[1m\033[33m");
msg += sprintf("%4s", finished+"") + "/" + sprintf("%4s", sum+"");
msg += " " + sprintf("%4s", Math.floor(finished*100/sum)+"%");
msg += c("\033[39m\033[22m") + ")";
}
for(var i = 0; i < chars; i++)
process.stderr.write("\b");
process.stderr.write(msg);
chars = msg.length;
var sum = 0;
var finished = 0;
var chars = 0;
function print() {
var msg = "";
if(sum > 0) {
msg += "compiling... (" + c("\033[1m\033[33m");
msg += sprintf("%4s", finished+"") + "/" + sprintf("%4s", sum+"");
msg += " " + sprintf("%4s", Math.floor(finished*100/sum)+"%");
msg += c("\033[39m\033[22m") + ")";
}
events.on("task", function(name) {
sum++;
print();
});
events.on("task-end", function(name) {
finished++;
if(name) {
for(var i = 0; i < chars; i++)
process.stderr.write("\b \b");
process.stderr.write(name + " " + c("\033[1m\033[32m") + "done" + c("\033[39m\033[22m") + "\n");
chars = 0;
}
print();
});
events.on("bundle", function(name) {
sum = 0;
finished = 0;
for(var i = 0; i < chars; i++)
process.stderr.write("\b");
process.stderr.write(msg);
chars = msg.length;
}
events.on("task", function(name) {
sum++;
print();
});
events.on("task-end", function(name) {
finished++;
if(name) {
for(var i = 0; i < chars; i++)
process.stderr.write("\b \b");
process.stderr.write(name + " " + c("\033[1m\033[32m") + "done" + c("\033[39m\033[22m") + "\n");
chars = 0;
});
}
// do the stuff
webpack(input, options, function(err, stats) {
if(err) {
console.error(err);
return;
}
if(argv.json)
console.log(util.inspect(stats, false, 10, argv.colors));
else {
console.log(formatOutput(stats, {
colors: argv.colors,
"by-size": argv["by-size"],
verbose: argv.verbose,
context: options.context
}));
}
print();
});
}
events.on("bundle", function(name) {
sum = 0;
finished = 0;
for(var i = 0; i < chars; i++)
process.stderr.write("\b \b");
chars = 0;
});
}
// do the stuff
webpack(input, options, function(err, stats) {
if(err) {
console.error(err);
return;
}
if(argv.json)
console.log(JSON.stringify(stats));
else {
console.log(formatOutput(stats, {
colors: argv.colors,
"by-size": argv["by-size"],
verbose: argv.verbose,
context: options.context
}));
}
});
{
"name": "webpack",
"version": "0.6.1",
"version": "0.6.2",
"author": "Tobias Koppers @sokra",

@@ -5,0 +5,0 @@ "description": "Packs CommonJs/AMD Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loading of js, json, jade, coffee, css, ... out of the box and more with custom loaders.",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc