Files
dealplustech/node_modules/astro/dist/vite-plugin-integrations-container/index.js
Kunthawat 77ac4d2d05 feat: Upgrade to Astro with full PDPA compliance
PDPA Features:
 Cookie consent banner
 Consent logging API
 Admin dashboard
 Privacy Policy
 Terms & Conditions

Technical:
 Astro 5.x + Tailwind v4
 Docker on port 80
 SQLite database
 15 pages built

Ready for Easypanel deployment.
2026-03-12 10:01:04 +07:00

30 lines
1.0 KiB
JavaScript

import { normalizePath } from "vite";
import { runHookServerSetup } from "../integrations/hooks.js";
function astroIntegrationsContainerPlugin({
settings,
logger
}) {
return {
name: "astro:integration-container",
async configureServer(server) {
if (server.config.isProduction) return;
await runHookServerSetup({ config: settings.config, server, logger });
},
async buildStart() {
if (settings.injectedRoutes.length === settings.resolvedInjectedRoutes.length) return;
settings.resolvedInjectedRoutes = await Promise.all(
settings.injectedRoutes.map((route) => resolveEntryPoint.call(this, route))
);
}
};
}
async function resolveEntryPoint(route) {
const resolvedId = await this.resolve(route.entrypoint.toString()).then((res) => res?.id).catch(() => void 0);
if (!resolvedId) return route;
const resolvedEntryPoint = new URL(`file://${normalizePath(resolvedId)}`);
return { ...route, resolvedEntryPoint };
}
export {
astroIntegrationsContainerPlugin as default
};