Installation
To install, run the following command with your preferred package manager.
npm install @sheepdog/vanillayarn add @sheepdog/vanillapnpm install @sheepdog/vanillabun add @sheepdog/vanillaSetup the Async Transform
Section titled “Setup the Async Transform”The Async Transform is a Vite plugin so to set it up you need to modify your vite.config.{js|ts}
import { asyncTransform } from '@sheepdog/vanilla/vite';import { defineConfig } from 'vitest/config';
export default defineConfig(({ mode }) => ({ plugins: [ asyncTransform(), ], // rest of your config}));And that’s it! You can now use async tasks with proper mid-run cancellation!
Remember: the Async Transform will only change your code in some very specific places, read more about it in the async transform explainer.