-
Regarding another minifier than esprima, have you tried uglifyjs? It is build for Node.js and there are projects using it wrapped for a browser like https://github.com/Skalman/UglifyJS-online. I know close to nothing about the whole NPM/Node world, it's just what I had seen used for minification sometime before.
As for the minification problem in iconlaunch, I currently can not reproduce that because of changes I have done to iconlaunch since then. Probably because the problematic code now just uses other variable names after minification. I will have an eye on that and try to build a minimum sample if I see it happening again.
Yes... The problem I have is esprima seems more or less unmaintained now - and it's hard to find a decent minifier that can be bundled up and run in the browser and node.js.
Someone attempted using rollup at one point. but as I remember it was huge and ended up being a bit of a mess to use.
Oh, I misunderstood.
That shouldn't actually be a problem. Or was it generating a new global variable of that name?
If you do:
or:
Then there should be no problem - the function that uses
g
will only do it from the global scope, not the local one