Skip to content

Files are removed every build in webpack watch mode even cleanAfterEveryBuildPatterns off #152

Closed
@redplane

Description

@redplane

Issue description or question

Webpack Config

// List of directories to be cleaned.

// Absolute path to your webpack root folder (paths appended to this)

// Write logs to console.
verbose: true,

// Use boolean "true" to test/emulate delete. (will not remove files).
// Default: false - remove files
dry: false,

cleanOnceBeforeBuildPatterns: ['**\/*'],

protectWebpackAssets: true,

// allow the plugin to clean folders outside of the webpack root.
// Default: false - don't allow clean folder outside of the webpack root
dangerouslyAllowCleanPatternsOutsideProject: true
        

Environment

Run: npx envinfo --system --binaries --npmPackages clean-webpack-plugin,webpack

 System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
    Memory: 1.16 GB / 7.90 GB
  Binaries:
    Node: 10.13.0 - C:\Program Files\nodejs\node.EXE
    npm: 6.10.0 - C:\Users\leoli\AppData\Roaming\npm\npm.CMD

Package.json

"webpack": "^4.35.2"
"clean-webpack-plugin": "^3.0.0"

Everytime when webpack rebuilt the application (because watch mode has been enabled & files had changed), every files were removed.

Expectation:

Files are not removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions