Files
dealplustech/dealplustech-astro/node_modules/astro/dist/env/sync.js
Kunthawat Greethong 3ed9f3f3ff 🎨 Fix CSS: Import global.css + plain CSS styles
CSS was not being imported! Fixed:

 Added 'import ../styles/global.css' to BaseLayout.astro
 Rewrote CSS with plain CSS (not @apply which wasn't working)
 Cookie banner has inline styles as backup
 Font size: 16px base
 Solid colors: green-600 (#16a34a), gray-900 (#111827)
 Footer has policy links

Build: 12 pages 
2026-03-10 08:21:30 +07:00

30 lines
843 B
JavaScript

import fsMod from "node:fs";
import { TYPES_TEMPLATE_URL } from "./constants.js";
import { getEnvFieldType } from "./validators.js";
function syncAstroEnv(settings, fs = fsMod) {
if (!settings.config.experimental.env) {
return;
}
const schema = settings.config.experimental.env.schema ?? {};
let client = "";
let server = "";
for (const [key, options] of Object.entries(schema)) {
const str = `export const ${key}: ${getEnvFieldType(options)};
`;
if (options.context === "client") {
client += str;
} else {
server += str;
}
}
const template = fs.readFileSync(TYPES_TEMPLATE_URL, "utf-8");
const content = template.replace("// @@CLIENT@@", client).replace("// @@SERVER@@", server);
settings.injectedTypes.push({
filename: "astro/env.d.ts",
content
});
}
export {
syncAstroEnv
};