From b023c451f376d58760c6a6cfd225285b25e09779 Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Sat, 30 Apr 2022 20:11:09 +0800 Subject: [PATCH] Chore: add jotai vite plugin --- vite.config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index e914423..055bbcf 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,4 +1,6 @@ import react from '@vitejs/plugin-react' +import jotaiDebugLabel from 'jotai/babel/plugin-debug-label' +import jotaiReactRefresh from 'jotai/babel/plugin-react-refresh' import { defineConfig, splitVendorChunkPlugin } from 'vite' import { VitePWA } from 'vite-plugin-pwa' import windiCSS from 'vite-plugin-windicss' @@ -8,7 +10,9 @@ export default defineConfig( env => ({ plugins: [ // only use react-fresh - env.mode === 'development' && react(), + env.mode === 'development' && react({ + babel: { plugins: [jotaiDebugLabel, jotaiReactRefresh] }, + }), tsConfigPath(), windiCSS(), VitePWA({