bundle and optimize server and API routes and serve from output directory (decouple serve
task from source code)
#946
Labels
Milestone
serve
task from source code)
#946
Type of Change
Feature
Summary
As it stands right now (I believe) SSR routes are called directly from src/, but ideally they should bundle and resolved to JS files by the hybrid server so that running the final result and the CLI can be totally independent of the source code needing to be present.
Details
This should ensure that the CLI can be used independent of the source code, say if the server crashes or someone wants to write their own server and just build a static distribution through something like Docker. This means that if
greenwood serve
is called and there is no workspace directory, it should try and find the output directory and just start from that, assuming a pre-generated bundle. For example, in Next, if you clone a repo and just runnext serve
it will break until you at least run anext build
.Most importantly, this avoids false positives thinking something is working when using
serve
because it is hitting source code directly, not bundled output. Hit that again in #986. Blast you false positives! 😠This should also probably include API routes too after #1007 lands, and then will need to figure out how we change the shape of graph.json, which will have an impact on our graph output. Maybe something like
Additionally, if there are no pages/ but an /api/ directory, should we even output a default index.html / 404.html?
The text was updated successfully, but these errors were encountered: