Svelte preprocessor for expanding Macroforge macros in component script blocks
@macroforge/svelte-preprocessor
Svelte preprocessor for expanding Macroforge macros in component script blocks.
This module provides integration between Macroforge's macro expansion system and
Svelte's preprocessing pipeline. It intercepts <script> blocks in .svelte
files, detects @derive decorators, and expands them into generated code before
TypeScript compilation occurs.
svelte.config.js as part of the
preprocess array<script> block to this
preprocessor@derive decoratorsmacroforge binding to expand the macrosvitePreprocess()) in the
chainnpm install @macroforge/svelte-preprocessor
macroforgePreprocess - Whether to preserve @derive decorators in the
expanded output.ExpandResult - Whether to preserve @derive decorators in the expanded
output.MacroforgePreprocessorOptions - Configuration options for the Macroforge
Svelte preprocessor.macroforgePreprocess();
macroforgePreprocess({ keepDecorators: true });
macroforgePreprocess({ processJavaScript: true });
See the full documentation on the Macroforge website.
MIT