-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.ts
41 lines (39 loc) · 921 Bytes
/
astro.config.ts
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
import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import { defineConfig } from "astro/config";
import compress from "astro-compress";
// https://astro.build/config
export default defineConfig({
output: "static",
// adapter: cloudflare({ mode: "directory" }),
vite: {
resolve: {
// alias: [...(process.env.NODE_ENV === "production" ? esmsh() : [])],
},
},
integrations: [
mdx({
syntaxHighlight: "shiki",
shikiConfig: {
theme: "monokai",
},
}),
react(),
process.env.NODE_ENV === "production" && compress(),
].filter(Boolean),
});
function esmsh() {
return [
//
"react",
"react-dom/client",
"react-router-dom",
"@sentry/integrations",
"@sentry/react",
"canvas-confetti",
"bootstrap-icons",
].map((k) => ({
find: new RegExp(`^(${k}[/]?.*)$`),
replacement: "https://esm.sh/$1?bundle",
}));
}