-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.ts
65 lines (63 loc) · 1.51 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { resolve } from 'path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import checker from 'vite-plugin-checker'
import typescript from '@rollup/plugin-typescript'
export default defineConfig(({ mode }) => ({
plugins:
mode === 'development'
? [
react({
jsxRuntime: 'classic',
}),
checker({
overlay: {
initialIsOpen: false,
},
typescript: {
tsconfigPath: resolve(__dirname, 'tsconfig.json'),
},
}),
]
: [],
build: {
target: ['safari11.1', 'chrome64', 'firefox66', 'edge88'],
outDir: resolve(__dirname, './dist'),
sourcemap: true,
minify: false,
input:
mode === 'development'
? { main: resolve(__dirname, 'index.html') }
: undefined,
lib:
mode === 'development'
? undefined
: {
name: 'react-leaflet-geoman',
entry: 'src/index.ts',
fileName: 'index',
},
rollupOptions:
mode === 'development'
? {}
: {
plugins: [typescript({ tsconfig: './tsconfig.build.json' })],
external: [
'react',
'leaflet',
'react-leaflet',
'@geoman-io/leaflet-geoman-free',
],
},
assetsDir: '',
emptyOutDir: true,
},
server: {
host: '0.0.0.0',
open: true,
port: 3001,
fs: {
strict: false,
},
},
}))