-
Notifications
You must be signed in to change notification settings - Fork 83
/
vite.config.ts
51 lines (50 loc) · 1.5 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
base: './',
esbuild: {
// https://github.com/vitejs/vite/issues/8644#issuecomment-1159308803
logOverride: { 'this-is-undefined-in-esm': 'silent' },
},
plugins: [
react({
babel: {
plugins: ['babel-plugin-macros', 'babel-plugin-styled-components'],
compact: false,
},
}),
nodePolyfills(),
dts({
insertTypesEntry: true,
copyDtsFiles: true,
}),
],
build: {
minify: true,
outDir: './build/frontend/',
emptyOutDir: true,
manifest: true,
lib: {
entry: {
main: 'src/main.tsx',
index: 'src/lib.ts',
'icons/index': 'src/icons',
},
},
rollupOptions: {
input: ['src/main.tsx', 'src/lib.ts'],
output: {
name: 'Spotlight',
},
},
},
define: {
'process.env.NODE_ENV': JSON.stringify(mode),
'process.versions': '{node: "v19.4.0"}',
},
};
});