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

[RFC][V2] Support glob at package.json#source #3821

Closed
brillout opened this issue Nov 21, 2019 · 10 comments · Fixed by #9590
Closed

[RFC][V2] Support glob at package.json#source #3821

brillout opened this issue Nov 21, 2019 · 10 comments · Fixed by #9590

Comments

@brillout
Copy link

brillout commented Nov 21, 2019

💬 RFC

Currently, EntryResolver expects package.json#source to be the path of a file.

I'm building an SSR plugin for Parcel v2 and I'd like my users to be able to define multiple entry points. For example:

pages/
pages/package.json
pages/Landing.page.js
pages/about/About.page.js
pages/product/Product.page.js
...

where pages/package.json#source would be **/*.page.js. But globs are not supported for package.json#source.

It seems that currently the only way to have multiple entries is to have a package.json for each entry. But it would be silly to ask my users to create a new package.json each time they create a new page.

This is somewhat related to the discussion at #3302.

@DeMoorJasper DeMoorJasper added the 💬 RFC Request For Comments label Nov 21, 2019
@brillout brillout changed the title [RFC][V2] Support multi entry / support glob at package.json#source [RFC][V2] Support glob at package.json#source Nov 24, 2019
@ngdangtu-vn
Copy link

ngdangtu-vn commented Mar 27, 2022

This definitely a problem I encounter recently. Does anyone know why this bug hasn't been fixed? It has been a year since then right? Btw, my problem can not be solved by listing all the possible entries in source because it is very dynamic. A new entries can be added and removed anytime. Put a fix path is not a very good solution.

I believe glob for package.targets.*.source is necessary.

@buvinghausen
Copy link

buvinghausen commented May 13, 2022

Let me just state this is a +1 issue for me too.

My use case is having parcel build all the LESS files across multiple services and output the CSS in the same folder as the source less file so that Blazor will apply CSS Isolation (CSS Modules to the rest of the world) correctly. I need the ability to set multiple targets each with their own source (as a glob) and distDir which cannot be done in a single CLI command as far as I can tell.

I guess as a workaround I can use a library like npm-run-all and run all the builds/watches in parallel it would just be nice to have glob support in package.json#targets.*.source and have one parcel thread figure out all the caching build/watch scenarios.

@buvinghausen
Copy link

@mischnic I see a Port "1234" could not be used message pop up in the console when I spin up parcel watch in parallel threads but overall it does seem to be working as it recompiles the LESS files into CSS files from both thread watches.

@mischnic
Copy link
Member

Well, if you start multiple instances of Parcel, they can't all use the same port.
Just like starting multiple webservers won't automatically expose all of them correctly on the same port

@dev-inside
Copy link

Hey,
I stumbled over this post a couple of days ago. As I see, there is still no support for using package.json#source with glob-entries? Any news on this issue? I would love to get rid of my 10km long scripts^^

@Darrenbydesign
Copy link

I too am curious bout this getting resolved... as a newb to bundling I was enticed by Parcel for building a component library with less fuss than something like WebPack which made me want to pull my hair out... but this glob support is the one roadblock to smooth building for me

@bAmrish
Copy link

bAmrish commented Jan 20, 2024

I too am facing a problem where I need to specify multiple files in package.json#source section. Any information on if this bug is going to be fixed or not (either way) would be helpful.

@buvinghausen
Copy link

I too am facing a problem where I need to specify multiple files in package.json#source section. Any information on if this bug is going to be fixed or not (either way) would be helpful.

It's been open for 4+ years I think you can infer it will not be supported on any reasonable timeline at this point.

@Darrenbydesign
Copy link

I too am facing a problem where I need to specify multiple files in package.json#source section. Any information on if this bug is going to be fixed or not (either way) would be helpful.

It's been open for 4+ years I think you can infer it will not be supported on any reasonable timeline at this point.

Sadly you're likely correct

@dev-inside
Copy link

Well, then the docs might need an update. The good guys from Parcel should mention how and where it can be used or get rid of the part in the documentation completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants