mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-07-18 00:31:08 +00:00
700893ecac
* migrate to hatch * reorder tests * generic fixtures * straight forward conftest * fix docs generation * fix tox environments * reformat tomls * cleanup pyproject * some play with renaming * move root conftest into pytest plugins * fix setup script * move fixtures to __init__.py * remove duplicate fixtures * disable pylint warning * simplify configuration fixture * remove empty conftest * remove crap from local pyprojects
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import react from "@vitejs/plugin-react";
|
|
import path from "path";
|
|
import { defineConfig, type Plugin } from "vite";
|
|
|
|
function rename(oldName: string, newName: string): Plugin {
|
|
return {
|
|
enforce: "post",
|
|
generateBundle(_, bundle) {
|
|
if (bundle[oldName]) {
|
|
bundle[oldName].fileName = newName;
|
|
}
|
|
},
|
|
name: "rename",
|
|
};
|
|
}
|
|
|
|
export default defineConfig({
|
|
base: "/",
|
|
build: {
|
|
chunkSizeWarningLimit: 10000,
|
|
emptyOutDir: false,
|
|
outDir: path.resolve(__dirname, "../ahriman-web/package/share/ahriman/templates"),
|
|
rolldownOptions: {
|
|
output: {
|
|
assetFileNames: "static/[name].[ext]",
|
|
chunkFileNames: "static/[name].js",
|
|
entryFileNames: "static/[name].js",
|
|
},
|
|
},
|
|
},
|
|
plugins: [react(), rename("index.html", "build-status.jinja2")],
|
|
resolve: {
|
|
tsconfigPaths: true,
|
|
},
|
|
server: {
|
|
proxy: {
|
|
"/api": "http://localhost:8080",
|
|
},
|
|
},
|
|
});
|