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 a piece of code that relies on function.prototype.name like so
public typeIs<TNewType>(newTypeAssertion: new (...args: any[]) => TNewType) {
this.stringValue = `TypeIs:${newTypeAssertion.name}`
this.segmentType = 'typeIs'
return this.finialize<TNewType>()
}
Initially my terser options didn't set keep_fnames to true and that caused my web application in both chrome and edge to not function properly. Now it looks like this.
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
keep_fnames: true // This is so that the typeIs function works in production.
}
})
],
And now the function name does not get mangle in chrome but still somehow gets mangled in edge even with keep_fnames set to true. I did find a solution by doing this
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
keep_fnames: true // This is so that the typeIs function works in production.
compress: false // Now newTypeAssertion.name does not get mangled in edge as well.
}
})
],
But I don't want to do that because my bundle would increase quite a bit. Any clue as to why edge still mangles the function name and why setting compress to false works?
The text was updated successfully, but these errors were encountered:
I have a piece of code that relies on function.prototype.name like so
Initially my terser options didn't set keep_fnames to true and that caused my web application in both chrome and edge to not function properly. Now it looks like this.
And now the function name does not get mangle in chrome but still somehow gets mangled in edge even with keep_fnames set to true. I did find a solution by doing this
But I don't want to do that because my bundle would increase quite a bit. Any clue as to why edge still mangles the function name and why setting compress to false works?
The text was updated successfully, but these errors were encountered: