Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unused-files-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unused-files-webpack-plugin - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

lib/__tests__/index-test.js

9

CHANGELOG.md

@@ -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)

10

lib/index.js

@@ -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 @@ }

17

package.json
{
"__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

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