Giter Site home page Giter Site logo

Comments (3)

garygreen avatar garygreen commented on August 18, 2024 2

@chrisblossom well that's more like it! Nice easy to understand code that does something useful with the webpack build chain.

That's really why I'm just struggling to understand why this plugin has become popular - not to stamp on the hard work done on it, but if you take a look at the code it's really not doing anything special.

What's spurred me on to take a deep looker at plugins is because I've been moving from Gulp to Webpack (I'm a total noob at the moment) and it's pretty common to have this kind of thing to determine what to run in dev/production:

production ? <run this task | plugin> : noop

So I was wondering if there was a NoopPlugin for webpack of some kind - and woah, there is! https://github.com/QingWei-Li/noop-webpack-plugin

Intrigued, I took a look at the code:

module.exports = function () {
  return {
    apply: function () {}
  }
}

That's it. Literally does nothing and someone has created a plugin for it! So I just copied and pasted it at the top of my config and renamed it noop. Interesting enough it's got two versions, I assume the first version was doing too much? 🤣

I get similar kind of vibes from this plugin, at the meat of it it's just doing rimraf - presumably over a dist directory. The only other stuff it's doing is options for including/excluding certain directories - but my thoughts on that is the dist directory or whatever folder your adding really should be totally destructible, you shouldn't be storing any files or stuff in dist that should be ignored to begin with.

I dunno. I probably just have a limited understanding of it's greater usage. 🐧

from clean-webpack-plugin.

chrisblossom avatar chrisblossom commented on August 18, 2024

I came to the exact same conclusion. See discussion #60.

I created a plugin that keeps track of, and only removes unused webpack assets (no exclude required): chrisblossom/clean-self-webpack-plugin. I suggested merging it with this plugin, which I am still open to/think the community would benefit from.

from clean-webpack-plugin.

johnagan avatar johnagan commented on August 18, 2024

This seems resolved. thanks

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.