preprocess
effectPreprocess(...) is the low-level .svelte preprocessor entry used by the plugin.
ts
import { effectPreprocess } from "svelte-effect-runtime/preprocess";Most apps should use effect() from "svelte-effect-runtime" instead. Reach for effectPreprocess(...) only when you need to compose the transform manually.
Signature
ts
export interface EffectPreprocessOptions {
runtimeModuleId?: string;
effectModuleId?: string;
svelteModuleId?: string;
}
export function effectPreprocess(
options?: EffectPreprocessOptions,
): PreprocessorGroup;Semantics
- Rewrites
<script effect>blocks. - Rewrites supported markup
yield*expressions. - Injects runtime imports using
runtimeModuleId. - Injects
Effectimports usingeffectModuleId. - Uses
svelteModuleIdfor Svelte runtime helpers.