This package has been deprecated
This module has been deprecated because it has been merged with https://github.com/johnagan/clean-webpack-plugin
This module has been deprecated because it has been merged with johnagan/clean-webpack-plugin.
Webpack plugin to delete extraneous files created by Webpack
NOTE: Node v6+ and Webpack v2+ are supported and tested.
By default, this plugin will only remove files created by Webpack after compilation has completed. Zero config required. Although it can be configured to remove other files, it is not recommended.
npm install --save-dev clean-self-webpack-plugin
;;;;const outputPath = path;/** Remove project files before webpack is loaded.* Be sure it is not async.** It is HIGHLY recommended to handle the initial* build directory clean outside of this plugin / webpack.** Popular existing packages:*** -- I prefer this one, great glob support and has CLI (del-cli package)***/del;const webpackConfig =entry: pathoutput:path: outputPathfilename: 'bundle.js'plugins:;;
/*** Simulate the removal of files** default: false*/dryRun: true/*** Write Logs to Console* (Always enabled when dryRun is true)** default: false*/verbose: true/*** **WARNING**** Notes on the below options customPatterns and initialPatterns:** Neither of these options are recommended.* Use only if you know what you are doing.** They are unsafe...so test initially with dryRun: true.** Relative to Webpack's output.path directory.* If outside of webpack's output.path directory,* use path.resolve(process.cwd(), '')** These options extend del's pattern matching API.* See* for pattern matching documentation*//*** Custom pattern matching** Removes files on after every build that match this pattern.* Used for files that are not created directly by Webpack.** default: disabled*/customPatterns: 'static*.*' '!static1.js'/*** Removes files once prior to Webpack compilation** Again, this should be handled outside of Webpack.* See Usage example.** NOTE: customPatterns ARE included with this** default: disabled*/initialPatterns: '**';
Thanks To / Related Projects
This package was created with the great work / lessons learned from: