My web project is primarily Python, but I am using Webpack to compile and compress my Javascript, and it is working quite nicely.
The compilation takes a good little bit, but that's both expected and acceptable. However, when I run my tests locally, the only way that I've found to ensure that I have the latest Javascript is to compile it.
This becomes a big problem the more I desire to test. Most of the time the code I'm packing hasn't changed, because that's not what I'm working on. So between test runs webpack's output won't change. I still have to incur the cost of packing, because I can't guarantee that it hasn't changed.
Is there a way for webpack to see if the source files have changed since the last pack was created, and only pack if the pack that already exists isn't from the same source files?
There's no easy built-in way to do this, but someone wrote a plugin: only-if-changed-webpack-plugin. This checks the time on your entry file and also on all its dependencies and only rebuilds if something changed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With