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

Optionally load ts config files #695

Closed
nikolaik opened this issue May 30, 2021 · 1 comment
Closed

Optionally load ts config files #695

nikolaik opened this issue May 30, 2021 · 1 comment
Assignees
Labels
enhancement kind/enhancement New feature or request

Comments

@nikolaik
Copy link

nikolaik commented May 30, 2021

After #595 pulled inn @endemolshinegroup/cosmiconfig-typescript-loader we now transitively get the typescript dependency via ts-node in our project. This change increases node_modules size by ~57MB for module consumers, which seems a waste for everyone who are not running typescript. For us this ends up slowing down our CI runs by a small percent.

The proposed solution is to use the peerdependencyMeta field in package.json and declaring @endemolshinegroup/cosmiconfig-typescript-loader as an optional peer dependency. When configuring cosmicconfig, we detect if the dependency is installed using require.resolve and only then enable loading and setting up ts config files.

I'm pretty sure this would not make sense to handle downstream, since that project only works in a typescript context.

Would you consider a PR for this approach?

@dimaMachina
Copy link
Collaborator

Finally, it will be fixed by #1171 very soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants