Git Product home page Git Product logo

Comments (3)

johnagan avatar johnagan commented on May 20, 2024

Personally I'm 👎 on this, but if others feel strongly about it, I'm open to seeing a PR for it

from clean-webpack-plugin.

hassaans avatar hassaans commented on May 20, 2024

Imagine while a user's on your website and you deploy a new release. And then he moves to a page that used a dynamic import. It won't be able to find that chunk as it does not exist anymore.

from clean-webpack-plugin.

chrisblossom avatar chrisblossom commented on May 20, 2024

This is out of scope of this package.

If you are trying to keep old files, you'll need to write previous build assets to disk, then read the asset list and give the list to cleanOnceBeforeBuildPatterns / cleanAfterEveryBuildPatterns as negative patterns. Is fairly easily accomplished...look into webpack's done plugin hook. See also: clean-webpack-plugin.ts#L218-L234

But then again, you'll have a weird dev flow. You probably don't want the old build files in webpack's output.path directory.

A better solution than trying to keep a history build manifest would be to just copy all build files into a git-commited directory on release. Then after all cleaning / webpack build, copy the previous assets (be sure not to overwrite) back to webpack's output.path.

IMO, if this is what you are worried about, you should use a CDN and let them handle the caching.

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.