forked from antmicro/zephelin-trace-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
40 lines (35 loc) · 1.22 KB
/
vite.config.ts
File metadata and controls
40 lines (35 loc) · 1.22 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
/*
* Copyright (c) 2025 Analog Devices, Inc.
* Copyright (c) 2025 Antmicro <www.antmicro.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
import path from 'path';
import { viteSingleFile } from "vite-plugin-singlefile";
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
const production = command === 'build';
const plugin_list = [preact()];
if (mode === 'single-file') {
plugin_list.push(viteSingleFile());
}
return {
esbuild: {
drop: (production) ? ['console', 'debugger'] : [],
},
resolve: {
alias: {
'@': path.resolve(path.join(__dirname, "src")),
'@speedscope': path.resolve(path.join(__dirname, "third-party", "speedscope", "src")),
'@styles': path.resolve(path.join(__dirname, "src", "styles")),
"react": "preact/compat",
"react-dom/test-utils": "preact/test-utils",
"react-dom": "preact/compat", // Must be below test-utils
"react/jsx-runtime": "preact/jsx-runtime",
}
},
plugins: plugin_list,
};
});