1
Fork 0
holllo-org/vite.config.ts

35 lines
900 B
TypeScript

import path from "node:path";
import {defineConfig} from "vite";
import nunjucks from "vite-plugin-nunjucks";
const relative = (input: string) => new URL(input, import.meta.url).pathname;
const buildDir = relative("build");
const sourceDir = relative("source");
export default defineConfig({
build: {
minify: false,
outDir: buildDir,
rollupOptions: {
input: {
fangs: path.join(sourceDir, "fangs/index.html"),
home: path.join(sourceDir, "index.html"),
queue: path.join(sourceDir, "queue/index.html"),
"re-nav": path.join(sourceDir, "re-nav/index.html"),
"re-nav/share": path.join(sourceDir, "re-nav/share/index.html"),
},
},
sourcemap: true,
},
plugins: [
nunjucks({
nunjucksConfigure: {
throwOnUndefined: true,
},
}),
],
publicDir: path.join(sourceDir, "static"),
root: sourceDir,
});