2024-01-17 11:13:01 +00:00
|
|
|
import path from "node:path";
|
|
|
|
import {defineConfig} from "vite";
|
|
|
|
import nunjucks from "vite-plugin-nunjucks";
|
2022-03-27 21:21:21 +00:00
|
|
|
|
2024-01-17 11:13:01 +00:00
|
|
|
const relative = (input: string) => new URL(input, import.meta.url).pathname;
|
2022-03-27 21:21:21 +00:00
|
|
|
|
2024-01-17 11:13:01 +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: {
|
2024-01-17 11:13:01 +00:00
|
|
|
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,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
2024-01-17 11:13:01 +00:00
|
|
|
publicDir: path.join(sourceDir, "static"),
|
2022-03-27 21:21:21 +00:00
|
|
|
root: sourceDir,
|
|
|
|
});
|