-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
30 lines (26 loc) · 832 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
import { defineConfig } from "vite";
import { readdirSync } from "fs";
import { resolve } from "path";
const samplesFolder = resolve("src/samples");
const sampleFolders = readdirSync(samplesFolder, { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name);
const input = {
"presentation": resolve("index.html"),
...sampleFolders.reduce((res, sampleFolder) => {
res[sampleFolder] = resolve(samplesFolder, sampleFolder, "index.html");
return res;
}, {}),
};
module.exports = defineConfig(({ command }) => ({
base: command === "build" ? "https://esridevsummit.github.io/DS2022-Client-Side-3D-Analysis/" : "./",
build: {
rollupOptions: { input },
minify: "esbuild",
},
resolve: {
alias: {
json2csv: "json2csv/dist/json2csv.umd.js",
},
},
}));