Glob all files that are not compiled by webpack under webpack's context
Glob all files that are not compiled by webpack under webpack's context
Install with npm:
npm i --save-dev unused-files-webpack-plugin
Install with yarn:
yarn add --dev unused-files-webpack-plugin
webpack.config.babel.js
import UnusedFilesWebpackPlugin from "unused-files-webpack-plugin";
export default {
plugins: [
new UnusedFilesWebpackPlugin(options),
],
};
webpack.config.js
const { UnusedFilesWebpackPlugin } = require("unused-files-webpack-plugin");
module.exports = {
plugins: [
new UnusedFilesWebpackPlugin(options),
],
};
new UnusedFilesWebpackPlugin(options)
The (array of) pattern(s) to glob all files within the context.
["**/*.*"]
glob-all(patterns)
Emit error instead of warning in webpack compilation result.
false
true
to enable this featureThe options object pass to second parameter of glob-all
.
{ignore: "node_modules/**/*"}
glob-all(pattern, globOptions)
, which then pass to glob(…, globOptions)
Ignore pattern for glob. Can be a String or an Array of String.
"node_modules/**/*"
options.ignore
Current working directory for glob. If you don't set explicitly, it defaults to the context
specified by your webpack compiler at runtime.
webpackCompiler.context
options.cwd
context
in webpack
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)