Wrap svelte reactive statements with custom events to allow devtools to detect them
npm i -D svelte-reactive-preprocessor
First import the package like this
const { reactivePreprocess } = require("svelte-reactive-preprocessor");
Then in the svelte loader options, add the reactive preprocessor like this
plugins: [
svelte({
preprocess: reactivePreprocess(),
}
],
If you are already using another preprocessor, add the reactive preprocessor like this
preprocess: [
sveltePreprocess(),
reactivePreprocess(),
],
The preprocessor options are listed below with their default values
reactivePreprocess({
enabled: true,
state: true,
})
Enable or disable the preprocessor
Whether to send the state to devtools. Set to false if you encounter performance issues.