-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
87 lines (85 loc) · 2.41 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
import { defineConfig } from 'astro/config';
import tailwind from "@astrojs/tailwind";
import partytown from "@astrojs/partytown";
import sitemap from '@astrojs/sitemap';
import { paraglide } from "@inlang/paraglide-js-adapter-vite";
import cloudflare from "@astrojs/cloudflare";
import solidJs from "@astrojs/solid-js";
import compress from "astro-compress";
// https://astro.build/config
export default defineConfig({
i18n: {
defaultLocale: 'ja',
// All urls that don't contain `es` or `fr` after `https://stargazers.club/` will be treated as default locale, i.e. `en`
locales: ['en', 'ja'],
// All supported locales
routing: {
prefixDefaultLocale: false
}
},
site: "https://rating-icon.pages.dev",
integrations: [tailwind(), partytown({
config: {
forward: ["dataLayer.push"],
resolveUrl: url => {
if (url.hostname === "www.googletagmanager.com") {
if ("https://www.googletagmanager.com/gtag/js?id=G-ZB1ZHFW237&l=dataLayer&cx=c" === url.href) {
return url;
}
if ("https://www.googletagmanager.com/gtag/js?id=G-ZB1ZHFW237" === url.href) {
return url;
}
if ("https://www.googletagmanager.com/gtm.js?id=GTM-WF44K9S9" === url.href) {
return url;
}
const proxyUrl = new URL("https://rating-icon.pages.dev/api/proxy/proxy");
proxyUrl.searchParams.append('url', url.href);
console.log(url);
return proxyUrl;
}
return url;
}
// debug: true,
}
}), sitemap({
i18n: {
defaultLocale: 'ja',
// All urls that don't contain `es` or `fr` after `https://stargazers.club/` will be treated as default locale, i.e. `en`
locales: {
en: 'en-US',
// The `defaultLocale` value must present in `locales` keys
ja: 'ja-JP'
}
}
}), solidJs(),
compress({
JavaScript: {
terser: {
compress: {
typeofs: false
}
}
}
}),
],
vite: {
plugins: [paraglide({
project: "./project.inlang",
outdir: "./src/paraglide"
}),
],
build: {
// minify: false,
// 超えたらやめる
// assetsInlineLimit: 0,
}
},
output: "hybrid",
// server: {
// headers: "Access-Control-Allow-Origin: https://www.googletagmanager.com"
// },
adapter: cloudflare({
mode: "advanced",
wasmModuleImports: true,
}),
});