-
Notifications
You must be signed in to change notification settings - Fork 650
/
vite.config.mts
44 lines (43 loc) · 1.1 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
42
43
44
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { resolve } from 'path'
import { libInjectCss } from 'vite-plugin-lib-inject-css'
import typescript from '@rollup/plugin-typescript'
import { typescriptPaths } from 'rollup-plugin-typescript-paths'
// https://vitejs.dev/config/
export default defineConfig({
build: {
copyPublicDir: false,
outDir: 'dist',
sourcemap: true,
lib: {
entry: {
index: resolve("src", 'index.ts'),
styles: resolve("src/lib", 'Timeline.scss')
},
name: 'react-calendar-timeline',
fileName: (format) => `react-calendar-timeline.${format}.js`
},
rollupOptions: {
external: ['react', 'react/jsx-runtime', 'react-dom', 'react-dom/client'],
output: {
globals: {
react: 'React'
}
},
plugins: [
typescriptPaths({
preserveExtensions: true,
}),
typescript({
outDir: 'dist',
declaration: true,
}),
],
},
},
server: {
port: 3000,
},
plugins: [react(), libInjectCss()],
})