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}.
Activity
probins commentedon Mar 22, 2017
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}.Fix mangling of Named Exports in Modules
Fix mangling of Named Exports in Modules (#518)