Skip to main content

Crate rhaiper

Crate rhaiper 

Source
Expand description

Minifier for Rhai scripts, with Source Map v3 output.

Strips comments, collapses whitespace, and drops redundant semicolons, while recording where every surviving token came from so a runtime error reported against the minified script can be traced back to the original source.

Correctness rests on re-lexing the output and requiring the token stream to be unchanged, so a broken script is never emitted silently.

Re-exports§

pub use emit::Mapping;
pub use emit::Options;

Modules§

emit
Turns a token table back into source text, as small as possible.
lex
Drives rhai’s own tokenizer over a StrStream, recording a token table.
map
Source Map v3 generation and position resolution.
rename
Shortening local variable names.
stream
An InputStream over a &str that tracks byte offsets.

Structs§

Minified

Enums§

Error

Functions§

minify
Minifies src, verifying the result before returning it.
minify_with_engine
Minifies src using a caller-supplied engine.