svelte-compiler
svelte-compiler provides the public compiler surface for working with Svelte in Rust.
It supports:
- parsing Svelte components into the public AST
- printing modern AST nodes back to source
- compiling components into JavaScript and CSS artifacts
- compiling rune-enabled modules
- preprocessing source with custom hooks
- best-effort source migration helpers
Install
[]
= "0.1.1"
Example
use ;
let result = compile?;
assert!;
# Ok::
Main APIs
compilecompiles a.sveltecomponentcompile_modulecompiles a rune-enabled JavaScript or TypeScript moduleparseparses a component into the public ASTprintandprint_modernturn AST nodes back into Svelte sourcepreprocessruns one or more preprocessors over source textmigrateperforms a best-effort migration to modern Svelte syntax
License
MIT