Open tajo opened 3 years ago
I guess what's happening is resolveDependencyManifest
and underlying resolve
need to set correct baseDir
(which is root
in our case and you can pick only one root). The fix could be being able to set mount
specific roots?
Weighing on this issue, also using multiple workspaces (yarn) in the same monorepo.
@tajo I don't think the solution is to have multiple roots but rather a relative resolution. Here's an example: Package A & B are in a mono-repo and both use a different version of a dependency. If Package A imports Package B which uses a different version of a dependency that snowpack finds first in Package A's root, there can/will be conflicts and issues.
So it means snowpack does not support yarn2 (berry) with monorepo. =\
Bug Report Quick Checklist
Describe the bug
Snowpack can't resolve dependencies from multiple yarn workspaces at the same time. Imagine this scenario with two workspaces
one
andtwo
:The workspace
one
importssnowpack
and some other dependencies (react, styled-components, debug...) to build the main web application (for example a storybook like project).The workspace
two
has stories / components that import some additional dependencies.The issue is I can't make snowpack to correctly mount both
one
andtwo
source folder and their dependencies. I can setroot
to workspaceone
but then it can't resolve deps intwo
and vice versa.The errors says something like this:
To Reproduce
Minimal repro.
getting this error
You can change
./one/run.js
root to__dirname
and get this error insteadExpected behavior
I tried multiple other
root
andworkspaceRoot
settings but nothing seems to be working? Is there some way to be able mount folder across workspaces?