-
Notifications
You must be signed in to change notification settings - Fork 8
/
vite.config.ts
38 lines (37 loc) · 961 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
33
34
35
36
37
38
import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh'
import dts from "vite-plugin-dts";
import path from 'path';
export default defineConfig({
server: {
port: 3004,
},
optimizeDeps: {},
plugins: [
reactRefresh(),
dts({
insertTypesEntry: true,
}),
],
build: {
lib: {
entry: path.resolve(__dirname, './src/index.tsx'),
name: 'react-nodetoy',
fileName: (format) => `react-nodetoy.${format}.js`,
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['react', 'react-dom', 'three', '@react-three/fiber'],
output: {
// Override dist folder because root is in the example/ folder
dir: 'dist',
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
react: 'React',
},
},
},
},
})