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

Per-file banner #2840

Open
arcanis opened this issue Jan 17, 2023 · 0 comments
Open

Per-file banner #2840

arcanis opened this issue Jan 17, 2023 · 0 comments

Comments

@arcanis
Copy link

arcanis commented Jan 17, 2023

It would be very useful if plugins were able to provide a set of custom defines or injects (basically a banner) on a per file basis without overriding the whole onLoad process (which would decrease perfs by preventing Esbuild from reading the files itself, and wouldn't work well with source maps).

It's kinda what you suggested in #859 for __dirname:

I think my preferred solution for this is going to be to use the --define feature in addition to adding the ability for plugins to add additional per-file configuration of input flags such as --define. This seems more general and appropriately minimal (not really adding more features, but just combining two existing features). This is not possible at the moment because plugins do not yet have the ability to configure these input flags per-file.

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