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

Documentation clarification of topic "Modules Resolution"? #592

Closed
JasonKleban opened this issue Apr 20, 2021 · 4 comments
Closed

Documentation clarification of topic "Modules Resolution"? #592

JasonKleban opened this issue Apr 20, 2021 · 4 comments
Labels

Comments

@JasonKleban
Copy link

JasonKleban commented Apr 20, 2021

It's very important to be aware that this plugin uses TypeScript's, not webpack's modules resolution. It means that you have to setup tsconfig.json correctly. For example if you set files: ['./src/index.ts'] in tsconfig.json, this plugin will check only index.ts for errors.

-- https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#modules-resolution

Does this mean that imports of index.ts will not be explored/checked? That was my initial interpretation, but then that behavior wouldn't match typescript's module resolution either - it would be basically no module resolution. I guess if build: true it would match, but if build: false then files array is just the entry points for the transpilation graph.

I'm trying to debug a build issue, and I need to gain confidence on this point, please. I'm running forked v6.2.1 and not getting any errors listed. Kind of like #319 except that's claimed to be fixed in v6.

@piotr-oles
Copy link
Collaborator

That's a good point - you're right, we should update the doc :) Would you like to create a PR to update it?

@JasonKleban
Copy link
Author

Thanks! But I don't know the complete correct answer to know what to replace it with.

@piotr-oles
Copy link
Collaborator

The plugin will use the same module resolution as TypeScript. The simplest option to check whether it's a configuration issue or a bug in the plugin is running the tsc command - in your case, it should be tsc --build --watch. If it works in TypeScript, then the issue is in the plugin, otherwise, the issue is in the configuration or TypeScript itself :)

@piotr-oles
Copy link
Collaborator

I will close this issue - if you find any problems with the build mode, please open another one with a description and reproduction repository :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants