Write on the margins of the internet. Powered by the AT Protocol. margin.at
extension web atproto comments

this sucks

+9 -4
+9 -4
web/astro.config.mjs
··· 6 7 const API_PORT = process.env.API_PORT || 8081; 8 9 // https://astro.build/config 10 export default defineConfig({ 11 adapter: node({ mode: "standalone" }), ··· 15 }, 16 vite: { 17 ssr: { 18 - noExternal: true, 19 - external: ["@resvg/resvg-js", "react", "react-dom", "react-router-dom"], 20 }, 21 build: { 22 chunkSizeWarningLimit: 1000, 23 }, 24 server: { 25 proxy: { 26 "/api": { 27 - target: `http://localhost:${API_PORT}`, 28 changeOrigin: true, 29 }, 30 "/auth": { 31 - target: `http://localhost:${API_PORT}`, 32 changeOrigin: true, 33 }, 34 },
··· 6 7 const API_PORT = process.env.API_PORT || 8081; 8 9 + const isDev = process.env.NODE_ENV === "development"; 10 + 11 // https://astro.build/config 12 export default defineConfig({ 13 adapter: node({ mode: "standalone" }), ··· 17 }, 18 vite: { 19 ssr: { 20 + noExternal: isDev ? /^(?!react|react-dom|react-router-dom|cookie)/ : true, 21 + external: ["@resvg/resvg-js"], 22 }, 23 build: { 24 + commonjsOptions: { 25 + transformMixedEsModules: true, 26 + }, 27 chunkSizeWarningLimit: 1000, 28 }, 29 server: { 30 proxy: { 31 "/api": { 32 + target: `http://127.0.0.1:${API_PORT}`, 33 changeOrigin: true, 34 }, 35 "/auth": { 36 + target: `http://127.0.0.1:${API_PORT}`, 37 changeOrigin: true, 38 }, 39 },