You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// case 1// inexportconstLongName=foo// outconsta=foo;export{aasLongName}// case 2 single reference - export statement// inconstLongName=foo;export{LongName}// outconsta=foo;export{aasLongName}// also in case 2,// DCE could have combined the declaration and the export statement// as export declarations are statically analysed// it doesn't matter where it is placed in the file (with ref.loc >= defn.loc)// replacing const x = foo; with export const x = foo; is a safe replacementconstLongName=foo;export{LongName}exportconstLongName=foo;// case 3 referenced multiple times// inconstLongName=foo;constLong2Name=()=>LongName(bar)+LongName(baz);export{LongName};export{Long2Name}// out 1consta=foo;constb=()=>a(bar)+a(baz);export{aasLongName};export{basLong2Name}// out 2exportconstLongName=foo;exportconstLong2Name=()=>LongName(bar)+LongName(baz)
perhaps worth stressing that this is only an issue for named exports; default export names can be mangled without problem (as at present). As mentioned in #394, the logic should be similar with imports: default import names can be mangled without problem; named imports could be mangled by using import {longName as a}.
+ Ref #479
This completes one part of the problem where now Named exports are no
more mangled. But the other part, where we can convert
```js
const foo = bar;
export {foo};
```
to
```js
export const foo = bar;
```
is yet to be explored in DCE or other plugins.
+ Ref #479
This completes one part of the problem where now Named exports are no
more mangled. But the other part, where we can convert
```js
const foo = bar;
export {foo};
```
to
```js
export const foo = bar;
```
is yet to be explored in DCE or other plugins.
Bug: Babili mangles exports
Possible solutions:
/cc @jdalton
The text was updated successfully, but these errors were encountered: