forked from titaniumnetwork-dev/Incognito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
105 lines (104 loc) · 3.32 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
import node from '@astrojs/node';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import { baremuxPath } from '@mercuryworkshop/bare-mux';
import { epoxyPath } from '@mercuryworkshop/epoxy-transport';
import playformCompress from '@playform/compress';
import { uvPath } from '@titaniumnetwork-dev/ultraviolet';
import icon from 'astro-icon';
import robotsTxt from 'astro-robots-txt';
import { defineConfig, envField } from 'astro/config';
import { viteStaticCopy } from 'vite-plugin-static-copy';
// https://astro.build/config
export default defineConfig({
site: process.env.SITE || 'https://localhost:8080',
integrations: [
tailwind(),
robotsTxt(),
sitemap(),
icon(),
playformCompress({
CSS: false,
HTML: true,
Image: true,
JavaScript: true,
SVG: true
})
],
output: 'server',
adapter: node({
mode: 'middleware'
}),
experimental: {
env: {
schema: {
BARE_SERVER_OPTION: envField.boolean({
context: 'client',
access: 'public',
default: true
}),
GAMES_LINK: envField.boolean({
context: 'client',
access: 'public',
default: true
}),
RAMMERHEAD_OPTION: envField.boolean({
context: 'client',
access: 'public',
default: false
}),
RAMMERHEAD_PREFIX: envField.string({
context: 'client',
access: 'public',
default: ''
})
}
}
},
vite: {
plugins: [
viteStaticCopy({
targets: [
{
src: `${uvPath}/**/*`.replace(/\\/g, '/'),
dest: 'uv',
overwrite: false
},
{
src: `${epoxyPath}/**/*`.replace(/\\/g, '/'),
dest: 'epoxy',
overwrite: false
},
{
src: `${baremuxPath}/**/*`.replace(/\\/g, '/'),
dest: 'baremux',
overwrite: false
}
]
})
],
server: {
proxy: {
'/wisp/': {
target: 'wss://ruby.rubynetwork.co/wisp/',
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(/^\/wisp\//, '')
},
'/bare/': {
target: 'https://ruby.rubynetwork.co/bare/',
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(/^\/bare\//, '')
},
'/gms/': {
target: 'https://rawcdn.githack.com/ruby-network/ruby-assets/main/',
changeOrigin: true,
ws: true,
secure: false,
rewrite: (path) => path.replace(/^\/gms\//, '')
}
}
}
}
});