Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

allow users to pass in their own resolve field #27

Merged
merged 2 commits into from Dec 3, 2018

Conversation

koddsson
Copy link
Contributor

@koddsson koddsson commented Nov 9, 2018

react-relay-networkd-modern needs to read .mjs for some reason. And I would like to use it in my project. The README instructs me to add this to my webpack config but webpack-config-github doesn't read it:

resolve: {
 extensions: ['.mjs', '.js']
}

This patch allows users of this package to pass in a resolve value and will make sure resolve.mainFields includes the correct values in addition to whatever the user supplied.

@koddsson koddsson requested review from josh and a team November 9, 2018 15:00
Copy link
Contributor

@josh josh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be fine just adding support for mjs for out of the box support instead of opening up a resolve option. We could maybe even add a test for this case 😁

@koddsson
Copy link
Contributor Author

koddsson commented Nov 9, 2018

Sounds good!

@koddsson
Copy link
Contributor Author

Webpack 4 has .mjs in the list of extensions. I couldn't find documentation for webpack 3 so I can't reference that but I'm guessing extensions doesn't include .mjs since the tests I added fail with out the .mjs extension in the list.

@koddsson
Copy link
Contributor Author

Once my relay-compiler PR is merged and we get out of this dependency hell I can merge make a test, merge this and make another PR to resolve .ts and .tsx files as well.

@koddsson
Copy link
Contributor Author

koddsson commented Dec 3, 2018

Once my relay-compiler PR is merged and we get out of this dependency hell I can merge make a test, merge this and make another PR to resolve .ts and .tsx files as well.

Oh I had already made a test, I guess I'm merging this 😆

@koddsson koddsson merged commit e173c73 into master Dec 3, 2018
@koddsson koddsson deleted the allow-resolve-extensions branch December 3, 2018 17:02
Copy link
Contributor

@josh josh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for adding this.

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

Successfully merging this pull request may close these issues.

None yet

2 participants