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
Flattening imports MUST take care of javascript reserved words #2680
Comments
I hit same bug rendering compiled bundles broken. Here is simple example. I'm using While NOTE: This is only a bug while emitting in |
BTW: Workaround right now is a little involved. in my case
It has to be indirected via a variable, calling |
Hi, thanks for this issue. As a matter of fact, I am currently working on a complete revamp of the variable resolution/deconflicting logic where it would be easy to incorporate these fixes. Will still take a little while, though. |
Because of the bug in rollup rollup/rollup#2680 re #5
Possible fix a #2689 |
* Refactor scope structure * Initial draft for new deconflicting solution with variable access tracking * Slightly improve some names * Deconflict CJS interop function * Cache findVariable via accessedOutsideVariables * Get rid of unnecessary parameter and improve name * Use objects instead of Sets to track used names * Only track global outside variables on module scopes, re-unify external variable handling with other import handling * Move warning about missing exports into Graph * Test variables are no longer needlessly deconflicted due to globals in other chunks * Use tree-shaking information when deconflicting * Deconflict build-in names, resolves #2680 * Make sure it resolves #2683 * Clean up chunk deconflicting code * Change priorities so that chunk variable names take precedence over imported variable names * Fix acorn import fix
How Do We Reproduce?
See https://github.com/matthiasg/rollup-reserved-word-issue/
Basically importing like this
import * as express from 'express'
and then usingexpress.static
does not work since the call is flattened to juststatic
which is a reserved word.Expected Behavior
The resulting file should either leave the
module.static
call or renamestatic
to a non-reserved wordActual Behavior
index.js
module.js
The text was updated successfully, but these errors were encountered: