Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
We need a simple yet effective strategy to make several invocations of
Of the time spent in the build, over 50% is now spent on minification, with only a very small fraction of time spent in the relocation loader.
Unfortunately Webpack internals don't seem like they offer much in the way of persistent caching right now (correct me if I'm wrong, but got this from - webpack/webpack#6527).
So I think the initial focus needs to be on minification (and TypeScript support when merged).
So the question then is how to properly cache minification in a way that can be shared between builds.
One option here could be running minification as a loader, having it apply per-input-source before Webpack does its tracing and concatentation. This would rely on caching all the other loaders and their emissions as well (including the relocation loader) and then having the previously generated source used when the input matches.
I'm not sure that per-source minification is a proven approach (please let me know if I'm wrong), so this would be yet to be seen what wins can be made here.