-
-
Notifications
You must be signed in to change notification settings - Fork 433
custom loader in chain with ts-loader consumes ts files #1271
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
Comments
I took a look at your repo and observed the same as you. I observed that if you include the transpileOnly option for ts-loader the problem goes away:
You may not be able to use transpileOnly but if I assume your loader converts the gql file to TypeScript then you may be OK for ts-loader to transpile the output to JavaScript without referencing the other files in the project. I don't think you need the I don't fully understand why this is happening. Perhaps if you don't include transpileOnly then ts-loader checks all ts files in scope, although it is surprising that it processes them through the loader. This issue discusses problems chaining loaders with transpileOnly as a solution: #223 (comment). Hopefully transpileOnly will solve your issue here. |
@appzuka yep, probably this is solution, but I would like to generate declaration files automatically, and when I was dealing with it, I found that |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing as stale. Please reopen if you'd like to work on this further. |
Expected Behaviour
Custom loader chained with ts-loader handles files that matches by webpack rule
test
configuration propertyActual Behaviour
Custom loader gets contents from
.ts
files, that doesn't match by webpack ruletest
configuration propertySteps to Reproduce the Problem
index.ts
file.ts
files, but actually the loader should work only with.gql
filesLocation of a Minimal Repository that Demonstrates the Issue.
https://github.com/roman0x58/webpack-chaining-issue
btw I'm not sure that is webpack or ts-loader issue.
The text was updated successfully, but these errors were encountered: