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

Support for node_modules in graphql imports, attempt 2 #216

Merged
merged 3 commits into from
Sep 7, 2018

Conversation

SpaceK33z
Copy link
Collaborator

@SpaceK33z SpaceK33z commented Aug 11, 2018

This is a continuation of PR #136 from @lfades (spoke to @lfades about this and he was okay with it).

It uses resolve-from instead of require.resolve with the paths option because it is not compatible with Node < 8.

Also I think this one works a bit differently; it doesn't introduce a breaking change since it will first try to look up the path relative to the file the import is in, and only if that fails it will use resolve-from.

Fixes #57

@bazaglia
Copy link

Tested & working really well! +1 for merging! @schickling are you ok with merging this?

# Conflicts:
#	package.json
#	src/index.ts
@SpaceK33z SpaceK33z merged commit 4c44f56 into ardatan:master Sep 7, 2018
@SpaceK33z SpaceK33z deleted the import-modules branch September 7, 2018 12:35
SpaceK33z added a commit that referenced this pull request Sep 7, 2018
SpaceK33z added a commit that referenced this pull request Sep 7, 2018
This is a continuation of PR #136 from @lfades (spoke to @lfades about this and he was okay with it).

It uses `resolve-from` instead of `require.resolve` with the `paths` option because it is not compatible with Node < 8.

Also I think this one works a bit differently; it doesn't introduce a breaking change since it will first try to look up the path relative to the file the import is in, and only if that fails it will use `resolve-from`.

Fixes #57
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.

Consider package imports.
2 participants