-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
27 lines (25 loc) · 835 Bytes
/
Copy pathastro.config.mjs
File metadata and controls
27 lines (25 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// @ts-check
import { defineConfig } from "astro/config";
import tailwindcss from "@tailwindcss/vite";
const normalizeBaseUrl = (value = "") => value.trim().replace(/\/+$/, "");
const hasEnvBaseUrl = Object.prototype.hasOwnProperty.call(process.env, "PUBLIC_BASE_URL");
const envBaseUrl = hasEnvBaseUrl ? normalizeBaseUrl(process.env.PUBLIC_BASE_URL) : "";
const defaultBaseUrl = normalizeBaseUrl("https://frushanto.com");
const baseUrl = hasEnvBaseUrl ? envBaseUrl : defaultBaseUrl;
// https://astro.build/config
export default defineConfig({
site: baseUrl || undefined,
i18n: {
defaultLocale: "en",
locales: ["en", "de"],
routing: {
prefixDefaultLocale: false,
},
},
vite: {
plugins: [tailwindcss()],
define: {
"import.meta.env.PUBLIC_BASE_URL": JSON.stringify(baseUrl),
},
},
});