-
Notifications
You must be signed in to change notification settings - Fork 1
/
astro.config.mjs
114 lines (112 loc) · 3 KB
/
astro.config.mjs
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import { defineConfig } from "astro/config";
import aws from "astro-sst";
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import solidJs from "@astrojs/solid-js";
import pagefind from "./integrations/pagefind";
import auth from "./integrations/auth";
import { loadEnv } from "vite";
import icon from "astro-icon";
import mdx from "@astrojs/mdx";
const { IS_PUBLIC, PRE_BUILD, CUSTOM_DOMAIN } = loadEnv(
process.env.NODE_ENV,
process.cwd(),
"",
);
const is_public = IS_PUBLIC === "true";
const is_pre_build = PRE_BUILD === "true";
// https://astro.build/config
export default defineConfig({
...(is_public
? {
output: "static",
adapter: aws(),
integrations: [
sitemap(),
pagefind({
is_pre_build: is_pre_build,
is_public: is_public,
}),
tailwind({
applyBaseStyles: false,
}),
solidJs(),
icon({
iconDir: "src/assets/icons",
}),
mdx(),
],
}
: {
output: PRE_BUILD ? "hybrid" : "server",
adapter: aws({
serverRoutes: ["/api/*"],
}),
integrations: [
sitemap(),
pagefind({
is_pre_build: is_pre_build,
is_public: is_public,
}),
tailwind({
applyBaseStyles: false,
}),
solidJs(),
icon({
iconDir: "src/assets/icons",
}),
mdx(),
auth({
injectEndpoints: true,
}),
],
}),
site: `https://${CUSTOM_DOMAIN}`,
cacheDir: "./cache",
compressHTML: true,
image: {
remotePatterns: [
{
protocol: "https",
},
],
service: {
entrypoint: "astro/assets/services/sharp",
config: {
limitInputPixels: false,
},
},
},
build: {
rollupOptions: {
external: ["/pagefind/pagefind.js"],
},
redirects: true,
},
vite: {
optimizeDeps: { exclude: ["auth:config"] },
},
redirects: {
"/lts": "/solutions/lts",
"/automotive-iot-and-edge-devices": "/projects/automotive-iot-edge",
"/cloud-computing-and-servers": "/projects/cloud-computing",
"/windows-on-arm": "/projects/windows-on-arm",
"/onelab": "/solutions/onelab",
"/services/qualcomm-platforms-services": "/projects/qualcomm-platform",
"/services/hands-on-training": "/services/training",
"/working-groups": "/",
"/projects": "/",
// '/core-technologies/[...slug]': "/",
"/core-technologies/virtualization": "/projects/automotive-iot-edge",
"/core-technologies/artificial-intelligence": "/solutions/ai-ml",
"/support": "/contact",
"/about/team": "/about",
"/about/tsc": "/about",
// '/learning-hub/[...slug]': '/about',
"/whitepapers/protecting-investment-in-code-optimisation-with-toolchain-ci-linaro-white-paper/":
"/whitepapers",
"/sig": "/",
"/latest/downloads": "/downloads",
"/connect/registration": "/404",
},
});