65 lines
1.3 KiB
TypeScript
65 lines
1.3 KiB
TypeScript
// Path: Frontend/app.config.ts
|
|
|
|
import { defineConfig } from "@solidjs/start/config";
|
|
import viteCompression from "vite-plugin-compression";
|
|
|
|
export default defineConfig({
|
|
server: {
|
|
preset: "static",
|
|
prerender: {
|
|
crawlLinks: true,
|
|
routes: ["/", "/404", "/auth/login"],
|
|
failonError: false,
|
|
},
|
|
},
|
|
|
|
//@ts-ignore
|
|
vite: ({ router }) => {
|
|
return {
|
|
build: {
|
|
target: "esnext",
|
|
},
|
|
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: `@use "/src/styles/_mixins.scss" as *; \n`,
|
|
},
|
|
},
|
|
},
|
|
|
|
server: {
|
|
allowedHosts: ["mangopig.tech", "komorebi-ai.com", "mangopig.com", "mangopiggy.com", "localhost"],
|
|
},
|
|
|
|
plugins: [
|
|
{
|
|
name: "inline-css-build",
|
|
apply: "build",
|
|
enforce: "post",
|
|
//@ts-ignore
|
|
transformIndexHtml(html, ctx) {
|
|
if (!ctx.bundle) return html;
|
|
//@ts-ignore
|
|
const cssFile = Object.values(ctx.bundle).find((file) => file.fileName.endsWith(".css"));
|
|
//@ts-ignore
|
|
if (!cssFile || !("source" in cssFile)) return html;
|
|
const styleTag = `<style>${cssFile.source}</style>`;
|
|
return html.replace(/<link rel="stylesheet"[^>]*?>/, styleTag);
|
|
},
|
|
},
|
|
|
|
viteCompression({
|
|
algorithm: "gzip",
|
|
ext: ".gz",
|
|
}),
|
|
|
|
viteCompression({
|
|
algorithm: "brotliCompress",
|
|
ext: ".br",
|
|
}),
|
|
],
|
|
};
|
|
},
|
|
});
|