0.0.2 • Published 7 years ago
webpack-del-plugin v0.0.2
Description
webpack-del-plugin allow you manage files during compilation process. This plugin using del package.
Usege
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, '*.*')}) ] };
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') ] }) ] };