generated from idrinth-api-bench/project-defaults
-
Notifications
You must be signed in to change notification settings - Fork 13
/
vite.config.ts
43 lines (42 loc) · 1.02 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
import {
defineConfig,
} from 'vite';
import react from '@vitejs/plugin-react';
import attributes from '@babel/plugin-syntax-import-attributes';
import plugin from '@idrinth-api-bench/rollup-plugin-react-modular-css';
import istanbul from 'babel-plugin-istanbul';
import million from 'million/compiler';
const babelPlugins = [
attributes,
million.babel(),
];
if (process.env.LIVE_SITE !== 'true') {
babelPlugins.push(istanbul,);
}
const config = {
// eslint-disable-next-line no-undefined
base: undefined,
build: {
rollupOptions: {
output: {
importAttributesKey: 'with',
},
plugins: [ plugin(), ],
},
},
plugins: [ react({
babel: {
plugins: babelPlugins,
generatorOpts: {
importAttributesKeyword: 'with',
},
},
},), ],
};
if (process.env.LIVE_SITE === 'true') {
config.base = 'https://iab-cdn.com/';
}
// https://vitejs.dev/config/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
export default defineConfig(config,);