Git Product home page Git Product logo

Comments (4)

ianseverance avatar ianseverance commented on May 20, 2024 1

@shlomisas As originally mentioned by @Jonathancollinet and stated in the documentation:

By passing dist as the path, you are asking for the dist folder itself to be cleaned (removed). To remove all of the files within the dist folder, your config should actually be

new CleanWebpackPlugin([
   'dist/*.*'          // Removes all files in `dist` folder
],
{
    root: projectRoot,
    watch: false       // You can delete this, as this does not change anything for your use case
})

and if your dist folder has multiple levels, make sure to include those paths as well

new CleanWebpackPlugin([
   'dist/*.*'          // Removes all files in `dist` folder
   'dist/**/*.*'       // Removes all files in `dist/**` folders
   'dist/**/**/*.*'    // Removes all files in `dist/**/**` folders
],
{
    root: projectRoot,
    watch: false       // You can delete this, as this does not change anything for your use case
})

from clean-webpack-plugin.

Jonathancollinet avatar Jonathancollinet commented on May 20, 2024

look at this

Paths (Required)

An [array] of string paths to clean

[
  'dist',         // removes 'dist' folder
  'build/*.*',    // removes all files in 'build' folder
  'web/*.js'      // removes all JavaScript files in 'web' folder
]

from clean-webpack-plugin.

shlomisas avatar shlomisas commented on May 20, 2024

as you can see in my code sample, i already have ['dist'] array as paths to clean, but it still deletes it everytime the watcher build instead of just on the first web pack build.

from clean-webpack-plugin.

chrisblossom avatar chrisblossom commented on May 20, 2024

Closed in v2.0.0 via #99. See johnagan/clean-webpack-plugin#usage. Please open a new issue if you continue to have problems.

from clean-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.