-
Notifications
You must be signed in to change notification settings - Fork 27
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
Allow externals #11
Comments
Have been thinking about how to accomplish this, and it appears doable with a caveat.
The caveat is it requires an extern for the import (and its shape for the imported name), but ... we might be able to generate an extern that matches your exact usage given we can parse the AST for all input files and find how a module is used. Details are here: |
Following this pattern I was able to get a small test pass to work for a React component. Input
Configuration
Output
|
This could work for many cases but once one pass the reference to imported stuff to i.e. a function call then we wouldn't be able to auto-detect it, right? |
Likely yes – not without going much more in-depth with the parsing and evaluation being done in the plugin. |
|
I'd like to try this plugin out for building libraries with dependencies and those dependencies have to be kept as externals and not bundled into the final flat bundle.
At the moment I get
The text was updated successfully, but these errors were encountered: