-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.js
38 lines (35 loc) · 957 Bytes
/
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
import { defineConfig } from "vite";
import { readdirSync } from "fs";
import { viteStaticCopy } from "vite-plugin-static-copy";
import { resolve } from "path";
const samplesFolder = resolve("src/samples");
const input = {
"presentation": resolve("index.html"),
};
for (const item of readdirSync(samplesFolder, { withFileTypes: true })) {
if (item.isDirectory()) {
input[item.name] = resolve(samplesFolder, item.name, "index.html");
} else if (item.name.endsWith(".html")) {
input[item.name] = resolve(samplesFolder, item.name);
}
}
module.exports = defineConfig(({ command }) => ({
base: "./",
build: {
rollupOptions: { input },
minify: "esbuild"
},
plugins: [
viteStaticCopy({
targets: [
{
src: "./src/samples/symbology-2d-3d/*.{png,gltf,bin}",
dest: "./src/samples/symbology-2d-3d/"
}, {
src: "./reveal.js",
dest: "./"
}
]
})
]
}));