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

Does not remove style only entries when running webpack in watch mode #24

Closed
eloiqs opened this issue Nov 12, 2019 · 1 comment
Closed

Comments

@eloiqs
Copy link

eloiqs commented Nov 12, 2019

The plugin is not removing style only entries on subsequent compilation when running webpack in watch mode. The first run goes fine, but then it runs into issues with the _collectedModules cache.

if (_collectedModules.indexOf(nextModule.id) === -1) {
_collectedModules.push(nextModule.id);
const depResources = collectEntryResources(nextModule, level + 1);
Array.prototype.push.apply(resources, depResources);

The first run will have already pushed the style only entries into it, and it will return an empty list for the resources of the module, it will then not be considered a style only module.

Would you consider reseting _collectedModules on every watch? Or maybe improving this cache to contain whether the module is style only (or not)?

@fqborges
Copy link
Owner

clearing collectedModules on watch on 0.5.0

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

No branches or pull requests

2 participants