-
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
"import *" seems to be broken #3650
Comments
Can you give a more complete repro case? This single file as given seems like it wouldn't compile since it's got an unfulfilled import: |
@blickly i am using @ampproject/rollup-plugin-closure-compiler which pulls in google-closure-compiler and sets up node resolution and esm, so that it understands imports. the online compiler seems to be set to BROWSER. the project is here: https://github.com/react-spring/react-three-fiber/tree/v5 and this is our config: https://github.com/react-spring/react-three-fiber/blob/v5/rollup.config.js#L73-L78 it prepends the missing import statement as plain text right now as a workaround |
OK, thanks. In general, Closure Compiler assumes that the ESM code will all be internal to the application being compiled and that it can removed in the optimized bundle. Thus it doesn't (yet) support outputting optimized code that still contains ESM syntax. So I would suspect that it's something else in the setup that is producing the ESM imports around the optimized code. If you can dig into the actual substep that is calling Closure Compiler you might uncover more. |
input:
output (compilation_level: SIMPLE_OPTIMIZATIONS):
馃憤
input:
output:
馃槙 it took away the
THREE
import for some reason,return THREE[a]
is now invalid.The text was updated successfully, but these errors were encountered: