You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
I think it will be useful when cached pages still requests for older assets.
What are your thoughts?
The text was updated successfully, but these errors were encountered: