generated from haydenull/logseq-plugin-react-boilerplate
/
vite.config.ts
32 lines (31 loc) · 813 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import react from '@vitejs/plugin-react'
import { resolve } from 'path'
import { defineConfig } from 'vite'
import usePluginImport from 'vite-plugin-importer'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
// eslint-disable-next-line react-hooks/rules-of-hooks
usePluginImport({
libraryName: 'antd',
libraryDirectory: 'es',
style: 'css',
}),
],
base: './',
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
build: {
target: 'esnext',
// minify: "esbuild",
},
define: {
// fix: https://github.com/excalidraw/excalidraw/issues/7331
// https://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#referenceerror-process-is-not-defined
'process.env.IS_PREACT': process.env.IS_PREACT,
},
})