mirror of
https://github.com/HananoshikaYomaru/openfreebooks.git
synced 2026-11-12 20:45:52 +00:00
33 lines
807 B
TypeScript
33 lines
807 B
TypeScript
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { defineConfig } from "vite";
|
|
import solid from "vite-plugin-solid";
|
|
|
|
const rootDir = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default defineConfig({
|
|
plugins: [solid()],
|
|
resolve: {
|
|
alias: {
|
|
"@ofb/katex": path.resolve(rootDir, "frontend/src/lib/katex.ts"),
|
|
},
|
|
},
|
|
server: {
|
|
fs: {
|
|
allow: [".."],
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "themes/openfreebooks/static",
|
|
emptyOutDir: false,
|
|
rollupOptions: {
|
|
input: "frontend/src/main.tsx",
|
|
output: {
|
|
entryFileNames: "js/bundle.js",
|
|
chunkFileNames: "js/[name]-[hash].js",
|
|
assetFileNames: (info) =>
|
|
info.name?.endsWith(".css") ? "js/katex.css" : "js/[name][extname]",
|
|
},
|
|
},
|
|
},
|
|
});
|