-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Other loaders are not applied to unchanged files in watch mode #1111
Comments
What an interesting use case! I didn't know that people were doing this - what do you use this behaviour for? I think we'd be open to pull requests to reintroduce this behaviour if you wanted to take a look at this? |
@johnnyreilly The behavior changed at v7.0.1 (cc31287). |
This is very mysterious. Could you do some debugging please? I'm interested in knowing which files are coming through that the regex change is relevant to. Given that the example you've given is a TypeScript file: https://github.com/iorate/uBlacklist/blob/58a4816d9ae74fd6507ca419c080271d8f86a46b/src/scripts/background/token.ts#L6-L10 I would expect this to pass the regex and behaviour to be identical. Do you want to put some |
Sorry, I was mistaken. I explored the history of The commit that introduced timestamp comparison was 44a2cdb :
The commit 388f2a6 , probably mistakenly, inverted the comparison:
Finally, cc31287 fixed it.
So the current behavior seems to be initially intended. I guess the current behavior is that: when a TypeScript file is changed, it is passed to However, even though unchanged files are passed to |
Hmm. Interesting. I think that the problem here is that we're reading the file from the filesystem instead of reading from webpacks compiler cache: Line 60 in 1b84fed
A workaround for now might be to use transpileOnly and run a seperate checker? |
I'm trying to replace Files passed to ts-loader can be taken as Is this the right way? |
Expected Behaviour
In watch mode, unchanged .ts files should be passed to loaders other than
ts-loader
, as in v6.2.2.Actual Behaviour
Unchanged .ts files are not passed to other loaders.
Steps to Reproduce the Problem
Please see the below repository. The version of
ts-loader
is7.0.4
../app.ts
and./error.ts
are transpiled using./remove-error-loader.js
andts-loader
(in this order)../error.ts
has an "error", but it is removed by./remove-error-loader.js
.When I run
npx webpack --watch
, it seems to be working well at first:However, when I update
./app.ts
(for example, change'Hello'
to'Hello, world!'
), an error occurs:This means that
./error.ts
(unchanged) is compiled by a TypeScript compiler, but not processed by./remove-error-loader.js
before that.With
ts-loader@6.2.2
, an update of./app.ts
does not cause an error:Is this regression, or expected behavior in v7?
Location of a Minimal Repository that Demonstrates the Issue.
https://github.com/iorate/ts-loader-error
The text was updated successfully, but these errors were encountered: