mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-04-07 02:53:38 +00:00
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { defineConfig, type Plugin } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
import path from "path";
|
|
|
|
function renameHtml(newName: string): Plugin {
|
|
return {
|
|
name: "rename-html",
|
|
enforce: "post",
|
|
generateBundle(_, bundle) {
|
|
if (bundle["index.html"]) {
|
|
bundle["index.html"].fileName = newName;
|
|
}
|
|
},
|
|
};
|
|
}
|
|
|
|
export default defineConfig({
|
|
plugins: [react(), tsconfigPaths(), renameHtml("build-status-v2.jinja2")],
|
|
base: "/",
|
|
build: {
|
|
outDir: path.resolve(__dirname, "../package/share/ahriman/templates"),
|
|
emptyOutDir: false,
|
|
rollupOptions: {
|
|
output: {
|
|
entryFileNames: "static/[name].js",
|
|
chunkFileNames: "static/[name].js",
|
|
assetFileNames: "static/[name].[ext]",
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
"/api": "http://localhost:8080",
|
|
},
|
|
},
|
|
});
|