unused-modules-webpack-plugin

1.0.1 • Public • Published

UnusedModulesWebpackPlugin

A Webpack plugin to find and report unused modules/files.

Installation

npm install --save-dev unused-modules-webpack-plugin

Usage example

Import the plugin and include the instance in your plugins array of your Webpack config file

... 
const UnusedModulesWebpackPlugin = require('unused-modules-webpack-plugin').UnusedModulesWebpackPlugin;
...
 
plugins: [
      new UnusedModulesWebpackPlugin({
      patterns: [
        "src/**/**.js",
        "!src/**/**.css",
      ],
      globOptions: { ignore: `node_modules/**/*` },
    }),
]
... 

Refer to the NPM package (glob-all)[https://www.npmjs.com/package/glob-all] for details on the globOptions that can be passed to your new instance.

Note that the plugin's output will be printed before Webpack's emit console output

Package Sidebar

Install

npm i unused-modules-webpack-plugin

Weekly Downloads

126

Version

1.0.1

License

ISC

Unpacked Size

3.87 kB

Total Files

3

Last publish

Collaborators

  • teebo_