-
-
Notifications
You must be signed in to change notification settings - Fork 433
configFileName can only be in root? #115
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
The property doesn't accept paths, that's true. However, the search for a tsconfig file starts at the entrypoint. You can use this to segregate your apps by using directories.
You may also need to use the "instance" option so that each app is separated into its own TypeScript instance, but you may not need to depending on your webpack configuration. All of that said, ts-loader should have feature parity with |
What are your thoughts on being able to specify |
In an earlier version of ts-loader you could do just that. However, once tsconfig.json was released I removed support for it. tsconfig.json is a much better place for that file list because all of your TS tooling knows how to read it, not just webpack. |
Ah, I see. Well, for sure, tsconfig.json absolutely makes a lot of sense for me and the typescript app I'm writing. atom-typescript, tsc, ts-loader can all use the same thing. I would just point out that, to someone else who maintains an es6 webpack app, who knows nothing about typescript, but may want to make use of a library React/Typescript component that I've written - to them, it may seem pretty unhelpful that they need an addition json config file just to tell TypeScript where to find the typings for React. For them, a files array in the webpack config is probably easiest. Course, I understand the absolute easiest way to start importing ts files, for people who don't know or care about typescript, may not be the goal here. Just pointing out this one perspective. Thank you for help with everything! |
I think it must be rewritten. If all config params are supplied through loader query and config file not found in search path, error occured due path.dirname does not accept I think it must be as
|
Guys, this is so old and this is not yet added as an option. WHY? Currently I have such a setup that I am generating a webpack build with a script that is installed as NPM package but it takes as input typescript files in a folder located in the root of the project. The tsconfig the webpack is using though is located in the npm package of the script not in the project root. When I start the webpack build it tries to load the tsconfig file from the project root and not from the package where the tsconfig actually is. WHY? My currently active directory is that of the package not the project root. So why does the ts-loaded tries to load the tsconfig file from the project root then? I am not sure but it's possible that there is also a bug here. And now the only workaround for me is to copy the tsconfig from the package to the typescript source folder in the project root (or in the project root itself) so this damn loader would find it. As you can guess I don't want to spam the project folder with additional or generated files so NOT having the option to specify path to the tsconfig file for ts-loader is a HUGE inconvenience for us. And it doesn't really seem like a big thing to fix or add as a feature. Please let me know when are you planning to fix this? |
We accept pull requests! Go to it 😄 |
Will definitely do it when I find the time and it's not yet added. |
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. |
My use case for
configFileName
is that I have many Webpack apps, some may want to use various typescript files, so I need different tsconfigs for each Webpack app to avoid compiling every .ts file for each. So I was psyched to find this as an option for ts-loader! But this property seems to not accept a path, and seems to not search in child directories for the given filename either. Having a variety ofappname_tsconfig.json
files in the root of the repo is not great. The typescript certainly accepts a path for config on the command line - is there a plan to support this in ts-loader?The text was updated successfully, but these errors were encountered: