Skip to content

The colors package used by the CLI pollutes the String prototype #5707

Closed
@rigor789

Description

@rigor789

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions