Skip to content

Installation

To install, run the following command with your preferred package manager.

Terminal window
npm install @sheepdog/vanilla

The Async Transform is a Vite plugin so to set it up you need to modify your vite.config.{js|ts}

vite.config.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.