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

Fix dependency resolution when using pnpm #774

Merged
merged 3 commits into from
May 7, 2018
Merged

Fix dependency resolution when using pnpm #774

merged 3 commits into from
May 7, 2018

Conversation

weichensw
Copy link
Contributor

@weichensw weichensw commented May 3, 2018

Fix #768

@weichensw
Copy link
Contributor Author

weichensw commented May 3, 2018

I attempted to create a execution-test but couldn't get pnpm to install nested file-based dependency. See this branch for an example:

  • The project depends on file: pkg1
  • pkg1 depends on file:../pkg2.

After pnpm i, pkg2 couldn't be found in node_modules, only pkg1 could be found. Is this expected @zkochan?

So in order to create a unit test I would need to include a real npm package that exhibits this re-export behavior, one that I know of is office-ui-fabric-react. But I am worried that installing real packages might slow down your tests too much. @johnnyreilly If you are OK then I could do that.

@zkochan
Copy link

zkochan commented May 3, 2018

@xbtsw the way pnpm currently works, it only symlinks directory dependencies but does not run install in the external package.

Though you can run pnpm recursive link in that project and it will do what you expected from pnpm install

@weichensw
Copy link
Contributor Author

It turns out to be using a folder dependency cannot trigger the error. The dependencies needs to be downloaded from a remote repository.

@johnnyreilly
Copy link
Member

But I am worried that installing real packages might slow down your tests too much. @johnnyreilly If you are OK then I could do that.

I am okay with that! Go forth and conquer!

@weichensw
Copy link
Contributor Author

@johnnyreilly The test is added. I am ready to merge. Please kindly review and comment 🤝

@johnnyreilly
Copy link
Member

Will do! I'm away from a keyboard for the next 5 days or so. Will check when I'm back. Thanks for your work!

@johnnyreilly johnnyreilly merged commit d1a2645 into TypeStrong:master May 7, 2018
@johnnyreilly
Copy link
Member

Thanks for your work! Released with https://github.com/TypeStrong/ts-loader/releases/tag/v4.3.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.

When dependencies are installed with pnpm, ts-loader behaves differently than tsc
3 participants