jackypan1989 / del-webpack-plugin Goto Github PK
View Code? Open in Web Editor NEWA file plugin help you remove old files after webpack (v5) bundling
Home Page: https://www.npmjs.com/package/del-webpack-plugin
License: MIT License
A file plugin help you remove old files after webpack (v5) bundling
Home Page: https://www.npmjs.com/package/del-webpack-plugin
License: MIT License
Look at this section:
const DelWebpackPlugin = require('clean-webpack-plugin')
Seems it's a typo.
from the code, it seems that only 'del' and 'chalk' are dependencies, others should be 'devDependencies'.
I want to delete files in output path, but I see the source code has auto ignore the files in output path
// exclude files
const excludePatterns = [
outputPath,
...this.options.exclude.map(name => path.join(outputPath, name)),
...assetNames.map(name => path.join(outputPath, name))
]
Very often I could put unneeded files into a single directory ("trash"), which I'd like to remove. So it would be is much easy to include single "trash"
directory to the plugin process, than enum every created file in exclude option.
I'm using version 1.0.5 of del-webpack-plugin, during build I receive this warning:
(node:64392) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
at DelWebpackPlugin.apply (/Users/kyuri/project/node_modules/del-webpack-plugin/dist/index.js:33:16)
at webpack (/Users/kyuri/project/node_modules/webpack/lib/webpack.js:37:12)
at options.map.options (/Users/kyuri/project/node_modules/webpack/lib/webpack.js:28:55)
at Array.map (<anonymous>)
at webpack (/Users/kyuri/project/node_modules/webpack/lib/webpack.js:28:40)
at Object.<anonymous> (/Users/kyuri/project/config/frontend/start.js:18:19)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
Got this error with webpack 4.
(node:26967) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
I would create a pull request but I really don't know how to fix this.
Hello.
Plugin by default removes all directories inside /build dir, because they're not listed in "added files" but matched by '**' includes.
For example, at start i have clean /build dir.
My webpack created sprites in /build/sprites/1.png dir.
And then plugin removes /build/sprites dir with my newly creates sprite.
Thus, it's needed to automatically exclude not only files, but also directories which has files which was created.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.