reactemplate/vite.config.ts

37 lines
636 B
TypeScript
Raw Permalink Normal View History

2022-04-02 18:30:58 +08:00
/// <reference types="vitest" />
2022-04-02 16:14:53 +08:00
import path from 'path'
2022-04-02 14:54:55 +08:00
import { defineConfig } from 'vite'
import AutoImport from 'unplugin-auto-import/vite'
import react from '@vitejs/plugin-react'
2022-04-02 18:30:58 +08:00
import Unocss from 'unocss/vite'
2022-04-02 14:54:55 +08:00
export default defineConfig({
resolve: {
alias: {
2022-04-02 16:14:53 +08:00
'~/': `${path.resolve(__dirname, 'src')}/`,
2022-04-02 14:54:55 +08:00
},
},
plugins: [
react(),
2022-04-02 17:04:33 +08:00
AutoImport({
include: [
'src/**/*.{ts,tsx}',
],
imports: [
{
react: [
'useState',
'useEffect',
],
},
],
}),
2022-04-02 19:08:53 +08:00
Unocss(),
2022-04-02 14:54:55 +08:00
],
2022-04-02 18:30:58 +08:00
test: {
environment: 'jsdom',
},
2022-04-02 14:54:55 +08:00
})