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§
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
InputStreamover a&strthat tracks byte offsets.
Structs§
Enums§
Functions§
- minify
- Minifies
src, verifying the result before returning it. - minify_
with_ engine - Minifies
srcusing a caller-supplied engine.