When we use the DedupePlugin in combination with
watch(), the initial build will be fine. However, any subsequent builds are broken, throwing the following error on this line:
Uncaught TypeError: Cannot read property 'apply' of undefined
To be clear, this is an error thrown by the inserted code in the built file at run time—not by webpack at build time.