forked from cheminfo/nmrium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
37 lines (35 loc) · 1016 Bytes
/
vite.config.ts
File metadata and controls
37 lines (35 loc) · 1016 Bytes
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
import react from '@vitejs/plugin-react';
import analyze from 'rollup-plugin-analyzer';
import { AliasOptions, splitVendorChunkPlugin } from 'vite';
import { defineConfig } from 'vitest/config';
// https://vitejs.dev/config/
export default () => {
let resolveAliases: AliasOptions = [];
if (process.env.WITH_PROFILING) {
resolveAliases = [
{ find: 'react-dom/client', replacement: 'react-dom/profiling' },
{ find: 'scheduler/tracing', replacement: 'scheduler/tracing-profiling' },
];
}
return defineConfig({
base: './',
esbuild: {
jsx: 'automatic',
sourcemap: true,
},
build: {
sourcemap: true,
rollupOptions: {
plugins: process.env.ANALYZE ? [analyze()] : [],
},
minify: process.env.NO_MINIFY ? false : 'esbuild',
},
plugins: [react(), splitVendorChunkPlugin()],
resolve: {
alias: resolveAliases,
},
test: {
include: ['./src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
},
});
};