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
I have some (ugly) legacy JS snippets that I want to include in my spack build (before it was loaded by a script tag) but the variables and function names gets modified.
E.g. there is a global render function that gets renamed to render1. Ho to keep it untouched?
I tried to set several mangle config options to false but it did not work :(
update:
Here is the index
import'./legacy';fnmain(){render("foo");}main();
And if I call the render method in the main function swc transforms the render in legacy.js to render1 but it I don't call it, it keeps the name?!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have some (ugly) legacy JS snippets that I want to include in my
spack
build (before it was loaded by ascript
tag) but the variables and function names gets modified.E.g. there is a global
render
function that gets renamed torender1
. Ho to keep it untouched?I tried to set several
mangle
config options tofalse
but it did not work :(update:
Here is the index
And if I call the
render
method in the main function swc transforms therender
inlegacy.js
torender1
but it I don't call it, it keeps the name?!Beta Was this translation helpful? Give feedback.
All reactions