Skip to content

Is it possible to import from a node_modules one level above? #639

Answered by developit
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

This is an oversight that we've been slowly working towards solving. In WMR 2, we moved the cache directory out of node_modules to allow for outside-of-CWD caching. Marvin also recently landed support for aliasing things from outside/above the current working directory, but we don't yet do node_modules resolution that takes this into account. The last step is a fairly major rearchitecture of how we do streaming npm install, which includes using Node's built-in module resolution (which supports nested node_modules directories).

There are a few workarounds in the meantime:

  1. if this is a monorepo and you're using yarn, you can mark the packages you want to reference from wmr as nohoist in t…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
1 participant