Skip to content

SMHFandA/webpack-del-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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')
    			]
    		})
    	]
    };

About

Webpack plugin for deleting files and folders.

Resources

License

Stars

Watchers

Forks

Packages

No packages published