How to prevent Closure Compiler from renaming any property or method of a specific object?

后端 未结 1 1825
长情又很酷
长情又很酷 2021-01-26 16:52

I am working with a huge 3rdparty library (Babylon JS) that will be served from its own CDN and cannot be included in my Closure Compiler run.

The library contains one o

相关标签:
1条回答
  • 2021-01-26 17:15

    The Closure Compiler has no feature that would allow you to say "don't rename any property on this object" except to disable property renaming entirely. The general idea is that it would be very easy for an "unrenamable object" to leak into a loosely typed value ('unknown', Object, etc) and disable renaming for the entire program. And that would make maintaining the expected optimizations for larger projects difficult. However, that is certainly something I would like the team to revisit at some point.

    0 讨论(0)
提交回复
热议问题