Socket
Socket
Sign inDemoInstall

grunt-webpack

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-webpack - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

5

package.json
{
"name": "grunt-webpack",
"description": "Use modules-webpack with grunt.",
"version": "0.2.1",
"version": "0.2.2",
"homepage": "https://github.com/sokra/grunt-webpack",

@@ -17,3 +17,4 @@ "author": {

"dependencies": {
"webpack": "0.4.x"
"webpack": "0.4.x",
"sprintf": "0.1.x"
},

@@ -20,0 +21,0 @@ "licenses": [

@@ -14,4 +14,25 @@ # grunt-webpack

## Configuration Example
``` javascript
webpack: {
someName: {
src: "client/lib/index.js",
dest: "asserts/[hash].js",
// all other webpack options here:
publicPrefix: "asserts/", // i.e.
// one extra option for grunt-webpack
statsTarget: "xyz", // writes the status to a variable named xyz
// you may use it later in grunt i.e. <%= xyz.hash %>
},
anotherName: {...}
}
```
`grunt-webpack` uses the [programmatically interface](https://github.com/sokra/modules-webpack#programmatically-usage).
The `watch` option is not valid for compiling with `grunt`, you have to use the watch function of grunt.
## License
Copyright (c) 2012 Tobias Koppers @sokra
Licensed under the MIT license.

@@ -10,2 +10,3 @@ /*

var path = require("path");
var sprintf = require("sprintf").sprintf;
module.exports = function(grunt) {

@@ -23,2 +24,46 @@

var done = this.async();
if(!options.events) options.events = new (require("events").EventEmitter)();
var events = options.events;
var sum = 0;
var finished = 0;
var chars = 0;
function c(str) {
return str;
}
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++)
grunt.log.write("\b");
grunt.log.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++)
grunt.log.write("\b \b");
grunt.log.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++)
grunt.log.write("\b \b");
chars = 0;
});
webpack(input, options, function(err, stats) {

@@ -25,0 +70,0 @@ if(err) {

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