GuideIntermediate~15 min
Loading...
GuideIntermediate~15 min
Loading...
Once your app works locally, ossido build turns it into something you can ship.
This guide goes from a production build to a deployed site, including trimming the
output and automating the deploy.
There are two, and they produce different artifacts (see SSR, SSG & Streaming):
Set the default in ossido.config.ts (output: 'static' | 'server'), or override
per build with the --static / --server flags.
ossido build runs your prebuild
hook, produces the artifacts, applies .ossidoignore, then runs postbuild. Build
via ossido build (not the lower-level ossido-build-prod) if you rely on those
hooks - only the CLI runs them.
Drop files you don't want deployed with a .ossidoignore at the project root - one
glob per line, # comments allowed (see
Excluding files):
Patterns match the emitted files, which are hashed - so target them with a glob
(some-chunk*), not the original source name.
Use the postbuild hook to push the output or drop in host-specific files. It runs
after the build and receives the output directory in its context (see
Automating with build hooks):
server.host /
server.port plus logging.format: 'json' for production (see
Running the production server
and Production config & env).