Socket
Book a DemoInstallSign in
Socket

webpack-cleanup-after-build-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-cleanup-after-build-plugin

Cleans up files from the build folder left over from previous builds, e.g. in watch mode.

1.0.2
latest
npmnpm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Webpack cleanup after build plugin

This plugin is a Webpack 4 plugin that cleans up extraneous files from the output directory. This is useful when running new builds or in watch mode, where new files are created all the time, but you don't necessarily want all these old files to stick around.

The plugin runs at the end of the build (after Webpack finishes emitting files), and removes files in the output folder that were not part of the completed compilation.

Usage

Just import the plugin and add it to your Webpack configuration.

import { WebpackCleanupAfterBuildPlugin } from 'webpack-cleanup-after-build-plugin'

export default {
  plugins: [
    new WebpackCleanupAfterBuildPlugin(options)
  ]
}

Options

You can optionally pass an options object to the plugin's constructor.

Option nameDefaultDescription
filesToKeep[]A list of files to never delete. Relative paths are assumed to be relative to the output path.
ignoreDotFilestrueWhether to ignore files and directories starting with a dot (".")

Example:

new WebpackCleanupAfterBuildPlugin({
  filesToKeep: [
    '.mydotfile',
    'not-generated-by-webpack.js'
  ],
  ignoreDotFiles: false
})

Keywords

wepback

FAQs

Package last updated on 29 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.