0.0.2 • Published 7 years ago

webpack-del-plugin v0.0.2

Weekly downloads
9
License
MIT License
Repository
-
Last release
7 years ago

Description

webpack-del-plugin allow you manage files during compilation process. This plugin using del package.

Usege

  1. Delete all files from dist folder before compiling bundle:

    const path = require('path');
    const WebpackDelPlugin = require('webpack-del-plugin');
    //...
    
    const ROOT_DIR = path.resolve(__dirname);
    const DIST_DIR = path.join(ROOT_DIR, 'dist');
    
    module.exports = {
    	// ...
    	plugins: [
    		// ...
    		new WebpackDelPlugin({match: path.join(DIST_DIR, '*.*')})
    	]
    };
  2. Delete particular files:

    const path = require('path');
    const WebpackDelPlugin = require('webpack-del-plugin');
    //...
    
    const ROOT_DIR = path.resolve(__dirname);
    const DIST_DIR = path.join(ROOT_DIR, 'dist');
    
    module.exports = {
    	// ...
    	plugins: [
    		// ...
    		new WebpackDelPlugin({
    			match: [
    				path.join(DIST_DIR, 'file1.js'),
    				path.join(DIST_DIR, 'file2.js')
    			]
    		})
    	]
    };