Terser mangling #609
Replies: 3 comments 1 reply
-
Ah, I wasn't aware of terser. If there is no way to disable mangling for specific functions then yeah we'd need to synthesize the string more carefully. |
Beta Was this translation helpful? Give feedback.
-
Ok, let me actually try that. |
Beta Was this translation helpful? Give feedback.
-
I looked into this a little bit and looks like the problem is deeper - basically all "globally" scoped variable names that are replicated in the string for worker setup need to be reworked. |
Beta Was this translation helpful? Give feedback.
-
It took me a bit to find out that the standard terser minifier was the culprit of generating exceptions after I incorporated the .js decoder into a glTF loader. https://github.com/zeux/meshoptimizer/blob/master/js/meshopt_decoder.js#L101C23-L101C23 assumes that the 'workerProcess' function name does not get mangled or transformed but this is the default behavior of terser.
It is possible to configure terser to skip mangling certain names and that works fine.
But perhaps there is a friendlier solution ? Would
= " + workerProcess.name + ";"
be an option ?Beta Was this translation helpful? Give feedback.
All reactions