Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent setAssets from modifying original externals array #450

Merged
merged 1 commit into from May 2, 2019

Conversation

ahlec
Copy link
Contributor

@ahlec ahlec commented Apr 4, 2019

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.

@NekR
Copy link
Owner

NekR commented May 2, 2019

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.

@NekR NekR merged commit 5a2947f into NekR:master May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants