-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Getting Bundled node_modules Separately from Source #2321
Comments
You're correct that this is not something esbuild does. You could probably figure out something with the plugin API: https://esbuild.github.io/plugins/. I'm imagining something like this:
For correctness you may need the dependencies in the bundle in step 2 to be lazily-initialized (if they have side effects and/or are supposed to only be conditionally imported). You could do that by e.g. re-exporting them as a function that calls |
Here's a dead-simple example of doing manual chunks (#207) by yourself: It doesn't include some more complex logic like
|
Closing because this was answered. |
Hi @evanw,
Our use case is a little different from the typical front-end use cases in that we want to use esbuild to build and package JS and TS to be used in something like AWS Lambda. We want the source code to be in a single bundle and all external dependencies still bundled and minified but in a separate file. Is there any way to currently do this using esbuild?
The text was updated successfully, but these errors were encountered: