1.0.5 • Published 2 years ago

unused-files-globby-webpack-plugin v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

unused-files-globby-webpack-plugin

Glob all files that are not compiled by webpack under webpack's context

Install with npm:

npm i --save-dev unused-files-globby-webpack-plugin

Install with yarn:

yarn add --dev unused-files-globby-webpack-plugin

Example usage

webpack.config.js

const { UnusedFilesWebpackPlugin } = require("unused-files-globby-webpack-plugin");

module.exports = {
  plugins: [
    new UnusedFilesWebpackPlugin({
      failOnUnused: true,
      globby: {
        patterns: [
          'src/**/*',
          'assets/**/*',
        ],
      },
    }),
  ],
};

Options

new UnusedFilesWebpackPlugin(options)

options.failOnUnused

Emit error instead of warning in webpack compilation result.

  • Default: false
  • Explicitly set it to true to enable this feature

options.globby.patterns

The (array of) pattern(s) to glob all files within the context.

  • Default: '**/*.*'
  • Directly passed to globby

options.globby.options

The options object pass to second parameter of globby.

  • Default: { gitignore: true }
  • Directly passed to globby
1.0.5

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago