// 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 = ``;
return html.replace(/]*?>/, styleTag);
},
},
viteCompression({
algorithm: "gzip",
ext: ".gz",
}),
viteCompression({
algorithm: "brotliCompress",
ext: ".br",
}),
],
};
},
});