unused-files-webpack-plugin
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -0,1 +1,10 @@ | ||
<a name"1.3.0"></a> | ||
## 1.3.0 (2015-09-07) | ||
#### Features | ||
* **options:** add failOnUnused to enable generating error ([7b7620d8](https://github.com/tomchentw/unused-files-webpack-plugin/commit/7b7620d8), closes [#3](https://github.com/tomchentw/unused-files-webpack-plugin/issues/3)) | ||
<a name"1.2.0"></a> | ||
@@ -2,0 +11,0 @@ ## 1.2.0 (2015-07-11) |
@@ -11,2 +11,3 @@ "use strict"; | ||
options.pattern = options.pattern || "**/*.*"; | ||
options.failOnUnused = options.failOnUnused === true; | ||
@@ -26,3 +27,3 @@ var globOptions = this.globOptions = objectAssign({ | ||
glob(this.options.pattern, globOptions, onGlobResult); | ||
glob(this.options.pattern, globOptions, onGlobResult.bind(this)); | ||
@@ -42,4 +43,9 @@ var fileDepsMap = this._getFileDepsMap(compilation); | ||
var errmsg = "UnusedFilesWebpackPlugin found some unused files:\n" + unused.join("\n"); | ||
var error = new Error(errmsg); | ||
compilation.warnings.push(new Error(errmsg)); | ||
if (this.options.failOnUnused) { | ||
compilation.errors.push(error); | ||
} else { | ||
compilation.warnings.push(error); | ||
} | ||
} | ||
@@ -46,0 +52,0 @@ } |
{ | ||
"__template__gist__": "https://gist.github.com/tomchentw/368a93bb748ad9d576f1#file-package-json", | ||
"name": "unused-files-webpack-plugin", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Glob all files that are not compiled by webpack under webpack's context", | ||
@@ -9,4 +9,8 @@ "main": "lib/index.js", | ||
"build": "echo 'build script' && exit 0", | ||
"test": "exit 1" | ||
"test:cov": "istanbul cover --report lcov tape $npm_package_config_tape", | ||
"test": "tape $npm_package_config_tape" | ||
}, | ||
"config": { | ||
"tape": "lib/**/*-test.js" | ||
}, | ||
"repository": { | ||
@@ -35,8 +39,13 @@ "type": "git", | ||
"devDependencies": { | ||
"tomchentw-npm-dev": "^3.0.0" | ||
"codeclimate-test-reporter": "^0.1.0", | ||
"istanbul": "^0.3.19", | ||
"memory-fs": "^0.2.0", | ||
"tape": "^4.2.0", | ||
"tomchentw-npm-dev": "^3.0.0", | ||
"webpack": "^1.12.1" | ||
}, | ||
"dependencies": { | ||
"glob": "^5.0.7", | ||
"object-assign": "^2.0.0" | ||
"object-assign": "^4.0.1" | ||
} | ||
} |
@@ -40,2 +40,9 @@ # unused-files-webpack-plugin [![Travis CI][travis-image]][travis-url] [![Quality][codeclimate-image]][codeclimate-url] [![Coverage][codeclimate-coverage-image]][codeclimate-coverage-url] [![Dependencies][gemnasium-image]][gemnasium-url] [![Gitter][gitter-image]][gitter-url] | ||
### options.failOnUnused | ||
Emit error instead of warning in webpack compilation result. | ||
* Default: `undefined` | ||
* Explicitly set it to `true` to enable this feature | ||
### options.globOptions | ||
@@ -42,0 +49,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12850
11
98
97
6
+ Addedobject-assign@4.1.1(transitive)
- Removedobject-assign@2.1.1(transitive)
Updatedobject-assign@^4.0.1