New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webpack-clean

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-clean

A webpack plugin to clean specified files after build

1.2.1
Source
npm
Version published
Weekly downloads
974
9.07%
Maintainers
1
Weekly downloads
 
Created
Source

Webpack Clean

A webpack plugin to clean specified files after build

Getting started

Install the plugin:

npm install webpack-clean --save-dev
yarn add webpack-clean --dev

API

new WebpackCleanPlugin(files: array|string, [ { [basePath: string], [removeMaps: boolean] } ])
  • files � array of files or string for a single file relative to the basePath or to the context of your config (if the basePath param is not specified),
  • basePath (optional) � directory to be resolved to
  • removeMaps (optional) � specify if the .map files should be automatically removed

Usage

var WebpackCleanPlugin = require('webpack-clean');

module.exports = {
    context: path.join(__dirname, './'),
    entry: './src/index.js',
    output: {
        filename: 'bundle.js',
        path: path.resolve(__dirname, 'dist')
    },
    plugins: [
        new WebpackCleanPlugin([
            'dist/test1.js',
            'dist/test2.js'
        ])
    ]
};

module.exports = {
    plugins: [
        new WebpackCleanPlugin(
            'dist/fileA.js',
            {basePath: path.join(__dirname, './')}
        )
    ]
};

module.exports = {
    plugins: [
        new WebpackCleanPlugin([
            'fileA.js',
            'fileB.js'
        ], {basePath: path.join(__dirname, 'dist'))}
    ]
};

module.exports = {
    plugins: [
        new WebpackCleanPlugin([
            'fileA.js',
            'fileB.js'
        ], {basePath: path.join(__dirname, 'dist'), removeMaps: true)}
    ]
};

Keywords

webpack

FAQs

Package last updated on 30 Apr 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