2.1.0 • Published 3 years ago

del-webpack-plugin v2.1.0

Weekly downloads
820
License
MIT
Repository
github
Last release
3 years ago

npm.io npm.io npm.io

Del-webpack-plugin

v2 was released, support webpack v5 !

A clean webpack plugin which can remove old files after bundling just as the well-known plugin clean-webpack-plugin, and more than it.

changelog

2021-04-01 (2.1.0): bump version, only use esbuild
2020-10-20 (2.0.0): rewrite to ts, rollup, and support webpack v5
2018-04-25 (1.0.5): upgrade to webpack v4
2018-05-28 (1.0.6): fix and update lib
2018-08-30 (1.1.0): add keepGeneratedAssets option
2018-10-18 (1.2.0): add allowExternal option

feature

  • webpack v5
  • typed source code
  • only delete after webpack compile
  • skip plugin if compile error
  • multiple entry / path support
  • include / exclude files support
  • verbose / mute info support
  • colorful log with chalk
  • example with webpack
  • support cross platform

npm.io

install

# use yarn
yarn add -D del-webpack-plugin

# use npm
npm i -D del-webpack-plugin

usage (in your webpack config)

const DelWebpackPlugin = require('del-webpack-plugin')

{
  plugins: [
    new DelWebpackPlugin({
      include: ['**'],
      exclude: ['test.js'],
      info: true,
      keepGeneratedAssets: true,
      allowExternal: false
    })
  ]
}

options

fielddesctypedefault
infoconsole.log added files and deleted filesbooleantrue
keepGeneratedAssetskeep webpack generated filesbooleantrue
allowExternalallows del-webpack-plugin to delete files outside of webpack root folderbooleanfalse
includea file list you wanna delete it will delete all files and folders by default, example: ['trash.js', 'trash/*.js']string[]['**']
excludea file list you dont wanna delete, example: ['test.js', 'test/*.js']string[][]

Welcome any issues and PRs submit :D

2.1.0

3 years ago

2.0.0

4 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago