Description
Feature request
What is the expected behavior?
It seems like the new version of WatchPack (v2.0.0) are getting rid of the mtimes
variable. However, from my research it seems like that variable was the only way to get the list of changed files that triggered a re-compilation (source).
As such, there should be an alternative way to get this list of changed files.
What is motivation or use case for adding/changing the behavior?
Seems like a pretty useful feature for the watchRun
hook, as there are already a couple people (including me) that use it.
How should this be implemented in your opinion?
Watchpack actually provides the info we need, in the variable filesModified
that it passes to Watching.js. However, Watching.js doesn't use it at all. Ideally I think this variable should be provided in the watchRun
hook, but it should also be fine to just store it as a property just like how it's done with removedFiles
, eg in Watching.js:
this.compiler.filesModified = filesModified;
Are you willing to work on this yourself?
yes
Activity
sokra commentedon Aug 27, 2019
Sounds good, send a PR
alexander-akait commentedon Aug 27, 2019
@sokra i think we should implement this in webpack@5 before stable release, can we move this in
yes
?Schweinepriester commentedon Oct 27, 2020
The PR was merged last year, but I think more docs would be great, as it seems like the change is only mentioned vaguely once in https://webpack.js.org/blog/2020-10-10-webpack-5-release/#new-watching, no other documentation.
Luckily I was able to figure it out - the tests were esp. helpful - and changed our usage of the plugin mentioned by @maxwoo-houzz
like so:
alexander-akait commentedon Oct 28, 2020
Yes, let's documented this
alexander-akait commentedon Oct 28, 2020
We have 4 variables here:
stefanprobst commentedon Nov 21, 2021
for directories, I am seeing empty objects in
compiler.contextTimestamps
- is that expected?is there also anything like
addedFiles
?malopgrics commentedon Nov 25, 2021
I done a
console.log
of each keys incompiler
that contains the stringfile
orFile
, and it output this :