-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.lib.ts
More file actions
31 lines (30 loc) · 762 Bytes
/
vite.config.lib.ts
File metadata and controls
31 lines (30 loc) · 762 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
30
31
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import { resolve } from 'path';
import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
// Configuration for library build
export default defineConfig({
plugins: [react(), dts({ include: ['lib'] })],
build: {
copyPublicDir: false,
lib: {
name: 'react-two.js',
entry: resolve(__dirname, 'lib/main.ts'),
fileName: (format, entryName) => `react-two-${entryName}.${format}.js`,
formats: ['es'],
},
rollupOptions: {
external: ['react', 'react/jsx-runtime', 'two.js'],
output: {
globals: {
react: 'React',
'two.js': 'Two',
},
},
},
},
server: {
port: 3000,
},
});