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

Clarify/Fix monorepo package resolution #8445

Open
CxRes opened this issue Sep 5, 2022 · 1 comment
Open

Clarify/Fix monorepo package resolution #8445

CxRes opened this issue Sep 5, 2022 · 1 comment

Comments

@CxRes
Copy link

CxRes commented Sep 5, 2022

🐛 bug report

Links to different packages in a monorepo do not resolve unless pointing directly to a file.
At least this is a case of documentation, though I suspect it is a bug.

🎛 Configuration (.babelrc, package.json, cli command)

Consider two packages 'a' and 'b':

a/package.json:

{
  "source": "./src/index.pug"
}

b/package.json:

{
  "source": "./src/index.pug"
}

😯 Current Behavior

Run:

parcel a otherpackages

With a file b/src/index.pug, none of the following are resolved:
a/src/index.pug:

a(href="/b/")
a(href="b/")
a(href="../../b")

But this works just fine:
a/index.pug:

a(href="/b/src/index.pug")

I can also run, but shouldn't need to:

parcel a b otherpackages

🤔 Expected Behavior

When the source is defined in package.json, Parcel should be able to resolve links to packages and build its contents as part of the build.

🔦 Context

Hard coding path to file is bad, as it breaks the decoupling between the packages. Changing the source in a package b will cause a build to break unless I now modify package a as well.

💻 Code Sample

🌍 Your Environment

Irrelevant in this instance!

Software Version(s)
Parcel 2.7.0
Node 18.8.0
npm/Yarn 8.13.2
Operating System Windows 10 x64
@CxRes
Copy link
Author

CxRes commented Sep 5, 2022

Incidentally, installing 'b' in 'a' and pointing to the npm package name does not work also!

@github-actions github-actions bot added the Stale Inactive issues label Mar 5, 2023
@parcel-bundler parcel-bundler deleted a comment from github-actions bot Mar 5, 2023
@mischnic mischnic added 🙋‍♀️ Feature and removed Stale Inactive issues labels Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants