Chore: add jotai vite plugin

This commit is contained in:
Dreamacro 2022-04-30 20:11:09 +08:00
parent 99e0576da4
commit b023c451f3

View File

@ -1,4 +1,6 @@
import react from '@vitejs/plugin-react' 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 { defineConfig, splitVendorChunkPlugin } from 'vite'
import { VitePWA } from 'vite-plugin-pwa' import { VitePWA } from 'vite-plugin-pwa'
import windiCSS from 'vite-plugin-windicss' import windiCSS from 'vite-plugin-windicss'
@ -8,7 +10,9 @@ export default defineConfig(
env => ({ env => ({
plugins: [ plugins: [
// only use react-fresh // only use react-fresh
env.mode === 'development' && react(), env.mode === 'development' && react({
babel: { plugins: [jotaiDebugLabel, jotaiReactRefresh] },
}),
tsConfigPath(), tsConfigPath(),
windiCSS(), windiCSS(),
VitePWA({ VitePWA({