clean-webpack-plugin
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -5,5 +5,5 @@ var rimraf = require('rimraf') | ||
function Plugin(paths) { | ||
function Plugin(paths, context) { | ||
// determine webpack root | ||
this.context = path.dirname(module.parent.filename); | ||
this.context = context || path.dirname(module.parent.filename); | ||
@@ -10,0 +10,0 @@ // allows for a single string entry |
{ | ||
"name": "clean-webpack-plugin", | ||
"version": "0.1.2", | ||
"name": "clean-webpack-plugin", | ||
"version": "0.1.3", | ||
"author": "John Agan <johnagan@github.com>", | ||
"description": "A webpack plugin to remove your build folder(s) before building", | ||
"description": "A webpack plugin to remove your build folder(s) before building", | ||
"homepage": "https://github.com/johnagan/clean-webpack-plugin", | ||
@@ -14,6 +14,6 @@ "licenses": "MIT", | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url" : "https://github.com/johnagan/clean-webpack-plugin.git" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url" : "https://github.com/johnagan/clean-webpack-plugin.git" | ||
}, | ||
"bugs": { | ||
@@ -20,0 +20,0 @@ "url": "https://github.com/johnagan/clean-webpack-plugin/issues" |
# Clean for webpack | ||
A webpack plugin to remove/clean your build folder(s) before building | ||
## Usage | ||
## `new Clean(paths, context)` | ||
* **Parameters** | ||
- **paths**: Array of paths *(example: ['dist', 'build'])* | ||
- **context**: root path, by default uses path where located *webpack.config.js* | ||
## Example | ||
``` javascript | ||
var Clean = require("clean-webpack-plugin"); | ||
var Clean = require('clean-webpack-plugin'); | ||
module.exports = { | ||
plugins: [ | ||
new Clean(['dist', 'build']) | ||
] | ||
plugins: [ | ||
new Clean(['dist', 'build']) | ||
] | ||
} | ||
@@ -17,2 +22,2 @@ ``` | ||
MIT (http://www.opensource.org/licenses/mit-license.php) | ||
MIT (http://www.opensource.org/licenses/mit-license.php) |
3330
22