Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Add remove-files-webpack-plugin #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add remove-files-webpack-plugin #161

wants to merge 1 commit into from

Conversation

Amaimersion
Copy link

@Amaimersion Amaimersion commented Feb 26, 2020

remove-files-webpack-plugin is a flexible plugin that removes files and folders before and after compilation.

Features

  • removing before and after compilation ("watch" mode is supported).
  • removing in trash.
  • removing outside the root.
  • before removing folders and files are checked for safety (i.e. if removing of folder/file is unsafe, then it will be not removed).
  • emulating of remove process.
  • flexible test system.
  • customizable log system.
  • pretty output.

Examples

new RemovePlugin({
    /**
     * Before compilation permanently removes
     * entire `./dist` folder.
     */
    before: {
        include: [
            './dist'
        ]
    }
})
new RemovePlugin({
    /**
     * After compilation removes in trash
     * all maps files in `./dist/styles` folder and 
     * all subfolders (e.g. `./dist/styles/header`).
     */
    after: {
        test: [
            {
                folder: 'dist/styles',
                method: (absoluteItemPath) => {
                    return new RegExp(/\.map$/, 'm').test(absoluteItemPath);
                },
                recursive: true
            }
        ],
        trash: true
    }
})

Pretty output

remove-files-webpack-plugin

Please see source readme for detailed description and examples.

@jsf-clabot
Copy link

jsf-clabot commented Feb 26, 2020

CLA assistant check
All committers have signed the CLA.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants