-
Notifications
You must be signed in to change notification settings - Fork 508
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
compress option in terser
inside production es rollup config produces invalid JS
#36
Comments
terser
inside production es rollup config produces invalid JS
@sw-yx Does it look similar to you? |
i saw your issue, yes it does look similar. |
What should we do here since it is downstream? |
what's the size impact on you if you turn off compress? i dont have the option because my code plain doesnt work without it (and its not like i'm doing some crazy nonidiomatic React stuff). as far as i can see, thats the only option for now, and i pray @TrySound can figure it out. We can also choose to document it as well as how to patch the package, for early adopters of TSDX who may run into this. |
To be honest terser code is a mess. I can't find a fix for that. You may turn off collapse_vars option. It should fix the problem. |
ohh i see. i thought there was no option available. thank you i will try that. |
So what should we do for now? |
@jaredpalmer i have verified that Bogdan's solution works. i recommend adopting it in tsdx and have PR'ed accordingly |
Current Behavior
here is my repo i'm working on https://github.com/sw-yx/react-netlify-identity-widget/tree/rollupProductionIssue
if you:
you will see this error:
however if you change the package.json to use the development versions:
it works!!
to me this indicates a rollup config issue.
Expected behavior
the production output should work the same as development output
Suggested solution(s)
i think this could be a terser bug. or a setting that is incompatible with React.
here is the offending unexpected token - prettified for easier reading
i'm not sure what rollup setting caused this but it definitely only exists in the production build.
Your environment
The text was updated successfully, but these errors were encountered: