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

Question: Build for browser with external modules in a folder? #3563

Closed
Alex134831 opened this issue Dec 26, 2023 · 2 comments
Closed

Question: Build for browser with external modules in a folder? #3563

Alex134831 opened this issue Dec 26, 2023 · 2 comments

Comments

@Alex134831
Copy link

Hello

I want to build an app for browser and have its dependencies (and their dependencies) in a folder like dist/libs/ separately. I don't want to merge anything. Of course this would need to update all import targets as well. Is this possible? If I need to make a plugin myself, what methods should I use?

@hyrious
Copy link

hyrious commented Dec 27, 2023

What you're asking for is #708, which is not implemented in esbuild. You may use rollup instead to do so.

@evanw
Copy link
Owner

evanw commented Dec 27, 2023

You can probably manage to do this yourself. To rewrite import paths in a given file, you can enable bundling and then make each non-entry import an external path. And then you can use a queue that continues creating new entry points for each unique resolved module path and running more bundling operations until everything is processed. But it could make more sense to use a tool with built-in support for that. In any case, I can close this as a duplicate of #708.

@evanw evanw closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2023
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

3 participants