evol-minifier

    A slightly faster JavaScript mangler/compressor for MoonBit.

    javascript
    parser
    compressor
    mangler
    Download zip
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    4 hours ago
    Downloads
    4

    #evol-minifier

    A JavaScript mangler/compressor for MoonBit, designed for the MoonBit JS backend.

    It parses modern JavaScript, resolves scopes, renames local identifiers, and prints minified JavaScript.

    ParseError

    pub suberror ParseError {
    UnexpectedToken(Position, String, String)
    UnexpectedCharacter(Position, Char)
    Unterminated(Position, String)
    InvalidEscape(Position, String)
    Syntax(Position, String)
    }

    A failure to parse or print JavaScript source.

    Each variant carries the data needed to describe the failure, and Show renders the user-facing message.
    impl Show for ParseError

    ParseError::output

    #deprecated("`ParseError::output` is deprecated, use `Show::output` instead.")
    fn ParseError::output(self : ParseError, logger : &Logger) -> Unit

    ParseError::to_string

    #deprecated("`ParseError::to_string` is deprecated, use `Show::to_string` instead.")
    fn ParseError::to_string(self : ParseError) -> String

    Position

    pub struct Position {
    line : Int
    column : Int
    }

    A 1-based source position, counted in UTF-16 code units.

    minify

    fn minify(source : String, internal_properties? : ArrayView[String]) -> String raise ParseError

    Removes unnecessary whitespace and renames local and top-level bindings. Public export names and names exposed to dynamic scope are preserved. internal_properties explicitly selects internal ASCII property names. These properties must not be part of external object interfaces or accessed through dynamically computed names. Other properties remain unchanged. Raises ParseError when the input cannot be parsed.

    minify_with

    fn minify_with(source : String, rename_top_level : Bool, internal_properties? : ArrayView[String]) -> String raise ParseError

    Minifies JavaScript, optionally renaming top-level bindings. Public export names are preserved in either mode. internal_properties has the same ownership requirements as minify. Raises ParseError when the input cannot be parsed.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io