-
Notifications
You must be signed in to change notification settings - Fork 6
/
vite.config.js
67 lines (63 loc) · 1.64 KB
/
vite.config.js
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { fileURLToPath, URL } from "node:url";
import { defineConfig, normalizePath } from "vite";
import vue from "@vitejs/plugin-vue2";
import { viteStaticCopy } from "vite-plugin-static-copy";
import { visualizer } from "rollup-plugin-visualizer";
import path from "node:path";
// Shouldn't be needed after moving to Vue 3
import { VuetifyResolver } from "unplugin-vue-components/resolvers";
import Components from "unplugin-vue-components/vite";
function joinAndNormalizePath(...paths) {
return normalizePath(path.join(...paths));
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
visualizer(),
Components({
resolvers: [VuetifyResolver()],
// Don't exclude girder web components
exclude: [
/[\\/]node_modules[\\/](?!(@girder[\\/]components[\\/]|\.pnpm[\\/]@girder.*))/,
/[\\/]\.git[\\/]/,
/[\\/]\.nuxt[\\/]/,
],
}),
viteStaticCopy({
targets: [
{
src: joinAndNormalizePath(
__dirname,
"itk",
"emscripten-build",
"**",
"*.{js,wasm.zst}",
),
dest: joinAndNormalizePath("pipelines"),
},
{
src: joinAndNormalizePath(
__dirname,
"node_modules",
"onnxruntime-web",
"dist",
"*.wasm",
),
dest: joinAndNormalizePath("onnx-wasm"),
},
],
watch: {
reloadPageOnChange: true,
},
}),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
optimizeDeps: {
exclude: ["itk-wasm"],
},
});