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

35 lines
900 B
TypeScript
Raw Normal View History

import path from "node:path";
import {defineConfig} from "vite";
import nunjucks from "vite-plugin-nunjucks";
2022-03-27 21:21:21 +00:00
const relative = (input: string) => new URL(input, import.meta.url).pathname;
2022-03-27 21:21:21 +00:00
const buildDir = relative("build");
const sourceDir = relative("source");
2022-03-27 21:21:21 +00:00
export default defineConfig({
build: {
minify: false,
outDir: buildDir,
2022-09-28 11:55:51 +00:00
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"),
2022-09-28 11:55:51 +00:00
},
},
2022-03-27 21:21:21 +00:00
sourcemap: true,
},
plugins: [
nunjucks({
nunjucksConfigure: {
throwOnUndefined: true,
},
}),
],
publicDir: path.join(sourceDir, "static"),
2022-03-27 21:21:21 +00:00
root: sourceDir,
});