tangled
alpha
login
or
join now
margin.at
/
margin
81
fork
atom
Write on the margins of the internet. Powered by the AT Protocol.
margin.at
extension
web
atproto
comments
81
fork
atom
overview
issues
3
pulls
1
pipelines
this sucks
scanash.com
2 weeks ago
b791eaab
3bdbb0b4
+9
-4
1 changed file
expand all
collapse all
unified
split
web
astro.config.mjs
+9
-4
web/astro.config.mjs
···
6
6
7
7
const API_PORT = process.env.API_PORT || 8081;
8
8
9
9
+
const isDev = process.env.NODE_ENV === "development";
10
10
+
9
11
// https://astro.build/config
10
12
export default defineConfig({
11
13
adapter: node({ mode: "standalone" }),
···
15
17
},
16
18
vite: {
17
19
ssr: {
18
18
-
noExternal: true,
19
19
-
external: ["@resvg/resvg-js", "react", "react-dom", "react-router-dom"],
20
20
+
noExternal: isDev ? /^(?!react|react-dom|react-router-dom|cookie)/ : true,
21
21
+
external: ["@resvg/resvg-js"],
20
22
},
21
23
build: {
24
24
+
commonjsOptions: {
25
25
+
transformMixedEsModules: true,
26
26
+
},
22
27
chunkSizeWarningLimit: 1000,
23
28
},
24
29
server: {
25
30
proxy: {
26
31
"/api": {
27
27
-
target: `http://localhost:${API_PORT}`,
32
32
+
target: `http://127.0.0.1:${API_PORT}`,
28
33
changeOrigin: true,
29
34
},
30
35
"/auth": {
31
31
-
target: `http://localhost:${API_PORT}`,
36
36
+
target: `http://127.0.0.1:${API_PORT}`,
32
37
changeOrigin: true,
33
38
},
34
39
},