-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
43 lines (41 loc) · 1.17 KB
/
vite.config.js
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
/// <reference types="vitest/config" />
import react from '@vitejs/plugin-react'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vite'
const __dirname = dirname (fileURLToPath (import.meta.url ))
export default defineConfig({
plugins: [react()],
build: {
lib: {
entry: resolve (__dirname, 'src/index.js'),
formats: ['es'],
name: 'HighTable',
// the proper extensions will be added
fileName: 'HighTable',
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['react', 'react/jsx-runtime', 'react-dom'],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
react: 'React',
'react/jsx-runtime': 'jsx',
'react-dom': 'ReactDOM',
},
},
},
sourcemap: true,
},
css:{
modules:{
// in the tsx file, the class name will be camelCase, eg: .table-scroll => classes.tableScroll
localsConvention:'camelCase',
},
}
,
test: { environment: 'jsdom', globals: true },
})