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

Wrong behavior when the same glob string is used in different directories #9

Open
MartinKolbAtWork opened this issue Feb 9, 2022 · 0 comments

Comments

@MartinKolbAtWork
Copy link

MartinKolbAtWork commented Feb 9, 2022

I have a scenario where a glob string (e.g. ./processor/**/*) is used in multiple places in files that are in different directories.
In these directories, the resolution of the globbing must result in different files. However, during processing, the globbing is done only once, and when the same glob string appears in a another file, then the same files are used again.

I provided an example in this Github repository:
https://github.com/MartinKolbAtWork/esbuild-plugin-import-glob-issue

The files in ProcessorManagerA.js and ProcessorManagerB.js both use the same glob string ./processor/**/*
The esbuild process can be started using npm run build.
The globbing from ProcessorManagerA.js should result in using the files Processor1 and Processor2.
The globbing from ProcessorManagerB.js should result in using the files Processor3, Processor4, and Processor5.

However, when looking into the output file out.js, it can be seen that only Processor1 and Processor2 were found and processed.

A pull-request that proposes a possible solution can be found here: #10

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

No branches or pull requests

1 participant