-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvite.config.ts
40 lines (39 loc) · 1.02 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
import { resolve } from 'path';
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
import dts from 'vite-plugin-dts';
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.tsx'),
name: 'VoiceRecorder',
fileName: 'react-voice-recorder-player',
},
rollupOptions: {
external: ['react'],
output: {
globals: {
react: 'React',
},
},
},
},
plugins: [
dts(),
react(),
svgr(),
cssInjectedByJsPlugin(),
],
define: {
RECORDING: JSON.stringify('recording'),
PAUSED_RECORDING: JSON.stringify('paused_recording'),
PAUSED_PLAYING: JSON.stringify('paused_playing'),
PLAYING: JSON.stringify('playing'),
PLAYING_REQUESTED: JSON.stringify('playing_requested'),
PROCESSING: JSON.stringify('processing'),
STOPPED: JSON.stringify('stopped'),
GRAPH_WIDTH: 2,
}
})