-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Feature Request: Emit path of CSS bundle to default export #2817
Comments
CSS bundle does not always
If you're sure that all your source code uses |
See that's a huge edge case that I completely missed. I understand now why that's how the system works. Re your first point about making As for your second point, I wasn't aware that CSS could be split the same way JavaScript can, because CSS performs no logic, so the whole concept of lazy-loading breaks down, therefore the concept is completely inapplicable. Perhaps I've misunderstood though. Thanks for your feedback |
Another consideration is that embedding a Ultimately the built-in behavior I have in mind for this is passing a HTML file to esbuild as the entry point where the |
hm. That's true, but I'm still convinced it's technically possible. Maybe it's against standard or good practice, but there's no advantage to not including this feature. That being said, @hyrious's point about ambiguity is valid, which would simply be addressed by saying How this feature is used is in the eye of the beholder and just let the user figure out how to handle things like two imports referring to the same bundle etc. Again, if this imposes a technical can-of-worms then I understand, but if not, then I don't see a reason to not include it. |
Wait, hang on. Regardless of what happens with this issue, the development model for esbuild definitely isn't "whatever is technically possible to build gets included." I intend to be careful and deliberate about what I add to esbuild's API. I'm balancing many concerns including cognitive complexity, usability for developers, maintenance overhead for me, and yes also what esbuild's API incentivizes in the ecosystem. We can keep this issue open to talk about it if you'd like. I just wanted to set expectations that this is not an "anything goes" type of project. |
No of course not. I didn't mean to imply that at all. In fact, I've read over a few other feature discussions and you make that abundantly clear, it just seems to me that there's not just space for a new feature here, but it seems that there's a hole here where that feature seems to be missing. Look, as I say, it's your project, and if you don't think this feature is necessary, or goes against the project ethos, that's your decision, but I just think there's a missing feature here. |
Hi @evanw
Every time I start a new project with ESBuild I find new uses for it, so thank you so much for it. But I have encountered one small issue with it, in that I was trying to start bundling CSS as well. My setup is as follows:
I was hoping for a way to retrieve the path of the bundled CSS file by using a default export like the
file
loader does, but without using plugins.So something like
Let me know what you think, and if that needs any tweaking.
Thanks again
The text was updated successfully, but these errors were encountered: