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 6 7 7 const API_PORT = process.env.API_PORT || 8081; 8 8 9 + const isDev = process.env.NODE_ENV === "development"; 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 - noExternal: true, 19 - external: ["@resvg/resvg-js", "react", "react-dom", "react-router-dom"], 20 + noExternal: isDev ? /^(?!react|react-dom|react-router-dom|cookie)/ : true, 21 + external: ["@resvg/resvg-js"], 20 22 }, 21 23 build: { 24 + commonjsOptions: { 25 + transformMixedEsModules: true, 26 + }, 22 27 chunkSizeWarningLimit: 1000, 23 28 }, 24 29 server: { 25 30 proxy: { 26 31 "/api": { 27 - target: `http://localhost:${API_PORT}`, 32 + target: `http://127.0.0.1:${API_PORT}`, 28 33 changeOrigin: true, 29 34 }, 30 35 "/auth": { 31 - target: `http://localhost:${API_PORT}`, 36 + target: `http://127.0.0.1:${API_PORT}`, 32 37 changeOrigin: true, 33 38 }, 34 39 },