forked from reef-defi/reef-ui-kit_moved
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
58 lines (54 loc) · 1.46 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import dts from 'vite-plugin-dts'
import checker from 'vite-plugin-checker'
import eslint from 'vite-plugin-eslint'
const path = require('path')
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
if (command !== "build") {
return {
plugins: [react(), checker({ typescript: true }), eslint()]
}
}
if (mode === "showcase") {
console.warn("This is showcase")
return {
base: "",
plugins: [react()]
}
}
return {
plugins: [react(), dts()],
publicDir: 'dist',
build: {
lib: {
entry: path.resolve(__dirname, 'src/ui-kit/index.tsx'),
name: '@reef/ui-kit',
formats: ['es'],
fileName: (format) => `index.${format}.js`
},
rollupOptions: {
input: path.resolve(__dirname, 'src/ui-kit/index.tsx'),
external: [
'@fortawesome/fontawesome-svg-core',
'@fortawesome/free-regular-svg-icons',
'@fortawesome/free-solid-svg-icons',
'@fortawesome/react-fontawesome',
'@polkadot/react-identicon',
'@types/jest',
'@types/node',
'@types/react',
'@types/react-dom',
'qrcode.react',
'react-syntax-highlighter',
'react-transition-group',
'react',
'react-dom',
'react-router-dom',
'bignumber.js'
]
}
}
}
})