The `colors` package used by the CLI pollutes the String prototype
rigor789 opened this issue · 0 comments
rigor789 commented
Issue Description
The colors module pollutes the string prototype (so it can do "text".bold etc), however this has a huge impact on strings. The issue mostly surfaces in webpack, since we are including the CLI library in it's utils to be able to read config values from nativescript.config.ts. That means, the string prototype is altered and affects the webpack compilation which relies on strings quite a lot, in the example case, it adds about 15 seconds to the build time.
More context:
NativeScript/NativeScript#10124
Proposal
Remove colors and switch to a light-weight library like ansi-colors and refactor any calls that use the prototype color modifiers.
Reproduction
No response
Relevant log output (if applicable)
No response
Environment
No response
Please accept these terms
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project's Code of Conduct