Vite 
INFO
Farfetched does not require any special configuration for Vite for basic usage. However, if you want to use advanced features like cache or server-side rendering, you need to configure Vite. Detailed explanation of the reasons is available in deep-dive article.
Vite uses ESBuild under the hood, which does not allow to use its internal AST in the plugins. To apply custom transformations to the code one must use either Babel or SWC, which are allowing custom AST-transformations.
Babel 
- Install required dependencies:
 
pnpm add --save-dev vite-plugin-babelyarn add --dev vite-plugin-babelnpm install --dev vite-plugin-babel- Add 
vite-plugin-babelto your project: 
// vite.config.ts
import { defineConfig } from 'vite';
import babel from 'vite-plugin-babel';
export default defineConfig({
  plugins: [
    // Babel will try to pick up Babel config files (.babelrc or .babelrc.json)
    babel(),
    // ...
  ],
});- Set up 
effector/babel-pluginin your Babel config: 
// .babelrc
{
  "plugins": ["effector/babel-plugin"]
}TIP
If you are using @vitejs/plugin-react in your project, you do not need to add vite-plugin-babel to your config, because it is already included in @vitejs/plugin-react. So, just modify your config to enable effector/babel-plugin.
// vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
  plugins: [
    react({
      babel: {
        plugins: ['effector/babel-plugin'],
      },
    }),
  ],
});SWC 
SWC is a blazing fast alternative to Babel.
WARNING
Note that plugins for SWC are experimental and may not work as expected. We recommend to stick with Babel for now.
Due to the experimental status of SWC plugins, we do not provide a detailed guide on how to use SWC with Farfetched. However, you can find an instruction in the official documentation of @effector/swc-plugin.
Disable HMR 
Effector does not support HMR yet. So, it's better to disable HMR for now to avoid unexpected behavior.
// vite.config.ts
export default defineConfig({
  server: {
    hmr: false,
  },
});