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

Add support for providing a list of field names to try instead of just using "main" #45

Merged
merged 3 commits into from
Jun 12, 2018

Conversation

christoffer-dropbox
Copy link
Contributor

This adds support to provide a list of field names in package.json to try when resolving modules. This is useful when using tsconfig-path in other environments than Node, such as Webpack (see tsconfig-paths-webpack-plugin for an example).

This is a required change to tsconfig-paths in an attempt to solve the issue described in: dividab/tsconfig-paths-webpack-plugin#20.

This PR shouldn't affect current usage, as the API still defaults to using "main", as verified by existing test cases.

@coveralls
Copy link

coveralls commented Jun 10, 2018

Coverage Status

Coverage decreased (-4.7%) to 81.754% when pulling 5745558 on christoffer:master into ee472ad on dividab:master.

@jonaskello
Copy link
Member

Nice work! I'll have to merge this one before I can get to the plugin. Would you care to add the API additions to the readme too? Specifically the new mainFields param that is now part of the createMatchPath and matchFromAbsolutePaths.

And reflect changes in README.md
@christoffer
Copy link
Contributor

Ah, thanks for pointing out I forgot those! Fixed.

@jonaskello
Copy link
Member

Thanks!

@jonaskello jonaskello merged commit 4e402ae into dividab:master Jun 12, 2018
@jonaskello
Copy link
Member

Published in 3.4.0.

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

Successfully merging this pull request may close these issues.

None yet

4 participants