-
Notifications
You must be signed in to change notification settings - Fork 42
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
Fix rebuilding all virtual files on any change #66
Conversation
@non25 Thanks! How about adding the test? Otherwise your fix might be easily regressed in the future due to other changes to this plugin |
@larixer That took me longer than I expected. |
It appears that only Webpack 4 needs this fix. |
@non25 Thanks, looks good, though I have fears about of this test stability |
@non25 Yeah, the test fails for me for |
@non25 Published your other changes in |
That is really interesting.
In webpack 5
In webpack 4
Don't know what to do. I feel like there's should be the test for checking are virtual modules rebuilt on any change, because that is really undesired behavior and it could pop up after some time. |
@non25 Oh, that was unexpected. Yeah, I have tried with |
@larixer Today I had an idea how to make rebuild test more robust by not trusting webpack's output on that and making loader which counts how many times it had been run... I think test commit is much better, but I can't pull request it until I find the solution to webpack 5 rebuilds... Also, I've added an example in the playground branch on how to test plugin with different webpack versions simultaneosly. |
@non25 There is an approach to use on Travis CI to test against multiple webpack versions we use for |
What's the problem this PR addresses?
This fixes #65
How did you fix it?
Barely fixed it.
I feel like there should be a better way to implement this sort of change, but at least I've found what caused rebuilds.
It was the abscence of virtual file timestamps in
compiler.fileTimestamps
, causing webpack to always reload virtual files.