-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
executable file
·106 lines (102 loc) · 2.36 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
import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import AutoImport from "astro-auto-import";
import { defineConfig, squooshImageService } from "astro/config";
import remarkCollapse from "remark-collapse";
import remarkToc from "remark-toc";
import config from "./src/config/config.json";
import icon from "astro-icon";
import aws from "astro-sst";
import { i18n, filterSitemapByDefaultLocale } from "astro-i18n-aut/integration";
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
// TODO: --changeDefaultLocale
// also need to adjust in i18n file -> utils/18n.ts
// search for changeDefaultLocale to find all the places where you'll have to switch default lang
const defaultLocale = "en";
const locales = {
en: "en-US", // the curent `defaultLocale`
es: "es-ES",
fr: "fr-CA",
de: "de-DE",
it: "it-IT",
ja: "ja-JP",
zh: "zh-CN",
th: "th-TH",
hi: "hi-IN",
};
export default defineConfig({
output: "server",
outDir: "dist",
adapter: aws({ serverRoutes: ["api/*"] }),
// site: config.site.base_url,
security: { checkOrigin: true, },
vite: {
plugins: [TanStackRouterVite()]
},
trailingSlash: "never",
build: {
format: "file",
},
base: "/",
trailingSlash: config.site.trailing_slash ? "always" : "never",
image: {
service: squooshImageService()
},
// image: {
// // service: passthroughImageService(),
// // entrypoint: "astro/assets/services/sharp",
// config: {
// limitInputPixels: false,
// },
// },
integrations: [
react(),
i18n({
locales,
defaultLocale,
exclude: ["pages/api/**/*"],
redirectDefaultLocale: true,
}),
sitemap({
i18n: {
locales,
defaultLocale,
},
filter: filterSitemapByDefaultLocale({ defaultLocale }),
}),
tailwind({
config: {
applyBaseStyles: false,
},
}),
AutoImport({
imports: [],
}),
mdx(),
icon({
include: {
tabler: ["*"],
},
}),
],
markdown: {
remarkPlugins: [
remarkToc,
[
remarkCollapse,
{
test: "Table of contents",
},
],
],
shikiConfig: {
theme: {
dark: "github-dark",
},
wrap: true,
},
extendDefaultPlugins: true,
},
});