-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Allow passing in a custom project root — different from the config root. #7206
Comments
You can use |
@mischnic I'm using the programmatic API here. Also, curious, does the location of This is my use case —
Here when running parcel's programmatic API to build |
This works correctly for me: https://github.com/mischnic/parcel-issue-7206 Does your "project" contain "yarn.lock", "package-lock.json", "pnpm-lock.yaml", ".git" or ".hg" file/folder? Otherwise you might be running into this case here:
So the cwd where the script is invoked from sets the root.
No. It's based on the entry points (or in a special case, the project root, take a look at the full statement from the code snippet above). |
I also encountered it because my project folder does not contain any lock files as it is in a subfolder of a monorepo. However, Parcel using monorepo root as the project root doesn't work for me so I had to create an empty .hg file.
Allowing setting a custom project root seems to be a good way to resolve this issue. |
Bump - its very annoying that the location of the entry point file dictates what the root of the project is wrt HMR etc. Files outside the root are not watched |
Uses the solution here parcel-bundler/parcel#7206 (comment)
* Removed lockfiles in workspaces Only the root workspace should have a lockfile * Use a .hg file to specify root for parcel Uses the solution here parcel-bundler/parcel#7206 (comment)
super annoying but thanks for the .hg workaround! |
I've had to explicitly chdir to the root directory before starting build/serve command, else it was unable to find page requisites.
And it created a whole lot of trash in the webroot in that case. Not the result I expect. Even in development environment. Another attempt
Not a lot better… |
💬 RFC
Hi there, congratulations on the v2 release — the new site looks fantastic.
I'm currently evaluating switching Bundlephobia from Webpack to Parcel.
If I understand this correctly, one of the limitations of parcel 2 seems to be that the parcel configuration and plugins are resolved from the same directories (project root) as the source files being built.
It'd be great if it was possible to specify a project resolve root that was in a different directory tree than
@parcel/core
itself.🔦 Context
How has this issue affected you? What are you trying to accomplish?
For bundlephobia's use case, the code to build packages lies in a different place than the code that gets built. This seems to be hard to do today with parcel without patching a bunch of packages.
The text was updated successfully, but these errors were encountered: