-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
49 lines (48 loc) · 1.42 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
44
45
46
47
48
49
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path';
// import {browserslistToTargets} from 'lightningcss';
// import browserslist from 'browserslist';
// https://vitejs.dev/config/
export default defineConfig({
// css: {
// transformer: 'lightningcss',
// lightningcss: {
// targets: browserslistToTargets(browserslist('>= 0.25%'))
// }
// },
build: {
// cssMinify: 'lightningcss',
lib: {
// Could also be a dictionary or array of multiple entry points
entry: {
components: path.resolve(__dirname, './src/components/index.js'),
utility: path.resolve(__dirname, './src/utility/index.js'),
// theme: path.resolve(__dirname, './src/lib/theme/theme.css'),
},
name: 'react-component-library-vite',
// the proper extensions will be added
// fileName: 'react-lib-vite',
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['react','react-dom','styled-components'],
// output: {
// // Provide global variables to use in the UMD build
// // for externalized deps
// globals: {
// vue: 'Vue',
// },
// },
},
// sourcemap:true,
emptyOutDir: true,
},
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: './tests/setup.js',
},
})