clean-webpack-plugin
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -1,4 +0,4 @@ | ||
var rimraf = require('rimraf') | ||
var rimraf = require('rimraf'); | ||
var path = require('path'); | ||
var join = path.join; | ||
var resolve = path.resolve; | ||
@@ -23,7 +23,7 @@ function Plugin(paths, context) { | ||
self.paths.forEach(function(path){ | ||
var path = join(self.context, path); | ||
path = resolve(self.context, path); | ||
rimraf.sync(path); | ||
}); | ||
} | ||
}; | ||
module.exports = Plugin; |
{ | ||
"name": "clean-webpack-plugin", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"author": "John Agan <johnagan@github.com>", | ||
@@ -5,0 +5,0 @@ "description": "A webpack plugin to remove your build folder(s) before building", |
# Clean for webpack | ||
A webpack plugin to remove/clean your build folder(s) before building | ||
## `new Clean(paths, context)` | ||
* **Parameters** | ||
- **paths**: Array of paths *(example: ['dist', 'build'])* | ||
- **context**: root path, by default uses path where located *webpack.config.js* | ||
#### new Clean(paths, context) | ||
| Parameter | Description | Example | | ||
|-----------|-------------|---------| | ||
| paths | An array of string paths to clean | ['dist', 'build'] | | ||
| context (optional) | The path root. By default uses ``webpack.config.js`` as root | './root' | | ||
@@ -13,4 +14,5 @@ ## Example | ||
var Clean = require('clean-webpack-plugin'); | ||
module.exports = { | ||
plugins: [ | ||
plugins: [ | ||
new Clean(['dist', 'build']) | ||
@@ -22,3 +24,2 @@ ] | ||
## License | ||
MIT (http://www.opensource.org/licenses/mit-license.php) | ||
http://www.opensource.org/licenses/mit-license.php |
3407
24