-
-
Notifications
You must be signed in to change notification settings - Fork 149
/
vite.config.mts
41 lines (35 loc) · 1.07 KB
/
vite.config.mts
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
import react from '@vitejs/plugin-react';
import {defineConfig} from 'vite';
import banner from 'vite-plugin-banner';
import dts from 'vite-plugin-dts';
import {version} from './package.json';
const header = `/*! @viselect/react v${version} MIT | https://github.com/Simonwep/selection/tree/master/packages/react */`;
export default defineConfig(env => ({
root: env.mode === 'production' ? '.' : './demo',
plugins: [react(), banner(header), dts()],
build: {
sourcemap: true,
minify: 'esbuild',
lib: {
entry: 'src/index.tsx',
name: 'SelectionArea',
fileName: 'viselect'
},
rollupOptions: {
external: ['react', 'react-dom', '@viselect/vanilla'],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'@viselect/vanilla': 'SelectionArea'
},
},
},
},
server: {
port: 3006
},
define: {
'VERSION': JSON.stringify(version)
}
}));