-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.js
24 lines (21 loc) · 737 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
import { defineConfig } from "vite";
import { readdirSync } from "fs";
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: command === "build" ? "https://esridevsummit.github.io/arcgis-js-api-for-javascript-3d-visualization/" : "./",
build: {
rollupOptions: { input },
minify: "esbuild",
},
}));