You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to give more support on development experience with "deployment adapters", e.g. with custom express server. Running full build each time when the .astro content is changed to make it work on a custom server is quite slow.
First, one needs to rebuild the whole website.
Second, one needs to restart the node / express server.
E.g. next.js somehow manages this without needing to rebuild the custom server at all, while watching the changes on its own.
reimport the module every time the middleware is requested, see below
importexpressfrom'express';constapp=express();app.use(express.static('dist/client/'));app.use((...args)=>{// clear import cache every time for reloading in dev modeimport('../dist/server/entry.mjs'+'?_='+Date.now()).then(({ handler })=>{handler(...args);});});app.listen(8080);
Both aren't very pleasant. First one because of nodemon-chaining (when astro content is changed, it gets rebuilt and then it triggers the rebuild of the express server). Second one has no chaining required (however still has two nodemons), but introduces dev-only logic into the application, that can potentially affect it in production, and most likely can introduce memory leaks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It would be great to give more support on development experience with "deployment adapters", e.g. with custom express server. Running full build each time when the .astro content is changed to make it work on a custom server is quite slow.
First, one needs to rebuild the whole website.
Second, one needs to restart the node / express server.
E.g. next.js somehow manages this without needing to rebuild the custom server at all, while watching the changes on its own.
The currently available options I could find are
Both aren't very pleasant. First one because of nodemon-chaining (when astro content is changed, it gets rebuilt and then it triggers the rebuild of the express server). Second one has no chaining required (however still has two nodemons), but introduces dev-only logic into the application, that can potentially affect it in production, and most likely can introduce memory leaks.
Beta Was this translation helpful? Give feedback.
All reactions