1.0.7 • Published 6 years ago

webpack-unused-files-plugin v1.0.7

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

webpack-unused-files-plugin

find unused files from your project.

Usage

yarn add webpack-unused-files-plugin

or

npm install webpack-unused-files-plugin

const WebpackUnusedFilesPlugin = require('webpack-unused-files-plugin');

// webpack config
module.exports = {
  plugins: [
    new WebpackUnusedFilesPlugin(options),
  ]
}

Options

const defaultOptions = {
  context: '',
  patterns: [
    "!**/node_modules",
    "!**/(test|tests)/**"
  ],
  sort: null, // 'ext', 'path'
  strict: false,
}
optionstypedescribedefaultrequired
contextstringtarget folderwebpack.contextfalse
patterns[]stringglob patterns!**/node_modules !**/testfalse
sortenumhow to display unused files, options ext, path
strictbooleanthrow an error when plugin find unused filefalsefalse

Example

config = {
  plugins: [
    new WebpackUnusedFilesPlugin({
      context: path.join(__dirname, 'src'), // find basic at src directory
      patterns: [ // NOTE: plugin will extend .gitignore
        "!**/*.log"
      ],
      sort: "ext", // plugin will sort unused file by file extenstion
      strict: true, // webpack compilcation build failed with an error
    }),
  ],
}
1.0.7

6 years ago

1.0.6

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago