-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
29 lines (28 loc) · 748 Bytes
/
vite.config.js
File metadata and controls
29 lines (28 loc) · 748 Bytes
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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
export default defineConfig({
plugins: [react({ jsxRuntime: 'automatic' })],
build: {
lib: {
entry: resolve(__dirname, 'src/index.js'),
name: 'ReactDice3D',
formats: ['es', 'cjs'],
fileName: (format) => `react-3d-dice.${format}.js`,
},
rollupOptions: {
external: ['react', 'react-dom', 'react/jsx-runtime', 'three'],
output: {
exports: 'named',
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'react/jsx-runtime': 'jsxRuntime',
three: 'THREE',
},
},
},
sourcemap: true,
minify: 'esbuild',
},
});