When using this plugin with wds and hot reloading, we noticed that as we reloaded, we'd receive an increasing number of warnings from the plugin with every reload. There'd be no warnings at first, then the first reload, there'd be one warning about how we should put a resource into externals, then a second reload there'd be warnings about all of our external resources.
I tracked it down to setAssets, which is being modified as it checks the externals to ensure they're defined. However, that means that multiple entries into this function destroy the original array, and produce these warnings. During the initial build, we'd have our array full; first reload, we'd have it slightly empty; second reload and forward, the externals array would be empty.
The change here seems like the simplest fix to the problem, and I don't believe should introduce any unexpected issues. I've confirmed that it does resolve the problem on our end.
Hey @ahlec. Thanks for the PR and sorry for delay.
It indeed seems to be working fine as all the tests pass. I'm going to go ahead and merge this. Hopefully will be able to cut a new release soon. Thanks again.
When using this plugin with wds and hot reloading, we noticed that as we reloaded, we'd receive an increasing number of warnings from the plugin with every reload. There'd be no warnings at first, then the first reload, there'd be one warning about how we should put a resource into externals, then a second reload there'd be warnings about all of our external resources.
I tracked it down to
setAssets
, which is being modified as it checks the externals to ensure they're defined. However, that means that multiple entries into this function destroy the original array, and produce these warnings. During the initial build, we'd have our array full; first reload, we'd have it slightly empty; second reload and forward, the externals array would be empty.The change here seems like the simplest fix to the problem, and I don't believe should introduce any unexpected issues. I've confirmed that it does resolve the problem on our end.