-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathvite.config.ts
More file actions
51 lines (50 loc) · 1.62 KB
/
Copy pathvite.config.ts
File metadata and controls
51 lines (50 loc) · 1.62 KB
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 babel from '@rolldown/plugin-babel';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
base: './',
server: {
watch: {
ignored: ['**/.venv/**', '**/build/**', '**/dist/**'],
},
},
plugins: [
react(),
babel({
plugins: ['babel-plugin-macros', 'babel-plugin-styled-components'],
compact: false,
}),
],
build: {
minify: true,
outDir: './build/frontend/',
emptyOutDir: true,
manifest: true,
lib: {
entry: {
main: 'src/main.tsx',
index: 'src/lib.ts',
'icons/index': 'src/icons',
},
// In library mode Vite names the bundled CSS after the package
// ("spotlight.css"), but the served template links "style.css".
// Pin the name so the built stylesheet (cropper.css, tippy.css,
// react-toastify.css, ...) is actually loaded in production.
cssFileName: 'style',
formats: ['es'],
},
rolldownOptions: {
input: ['src/main.tsx', 'src/lib.ts'],
output: {
name: 'Spotlight',
},
},
},
define: {
'process.env.NODE_ENV': JSON.stringify(mode),
'process.versions': '{"node": "v19.4.0"}',
},
};
});