gio build
Explains that a normal GioJS deploy has no build step; gio build standalone packages a self-contained deploy directory.
bash
gio build
gio build standalone [--out <dir>] [--target <platform>]Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
standalone | subcommand | - | Package the app into one directory that runs anywhere Node is installed. See gio build standalone for its options. |
-h, --help | boolean | - | Print the help and exit with 0. |
Behavior
Without a subcommand, gio build prints this and exits with 0:
text
GioJS has no build step for normal deploys: `gio start` starts the server,
renders on demand, and caches in Rust. To package a self-contained
deploy directory (one folder, runs anywhere Node is installed), use:
gio build standalone [--out <dir>] [--target <platform>]Any other argument is a usage error (exit code 2), with a suggestion for a near miss:
text
$ gio build stndalone
gio: unknown build target "stndalone" - did you mean `gio build standalone`?
Run `gio build --help` for usage.Examples
A build script for a server app
A server app has nothing to compile ahead of time, so the starter's build script only typechecks:
package.json
{
"scripts": {
"build": "tsc --noEmit",
"start": "cross-env NODE_ENV=production giojs-server"
}
}A build script for a static site
A site created with --static builds with gio export:
package.json
{
"scripts": {
"build": "tsc --noEmit && gio export"
}
}Good to know
- Unlike frameworks with a
next build-style step, GioJS bundles the client code when the server starts (into.gio/build) and renders pages on demand. A deploy isnpm cifollowed bygio start. - Use
gio build standalonewhen the target machine should not runnpm install, andgio exportfor a static host.
Related
Version history
| Version | Changes |
|---|---|
v0.1.0-beta.8 | A mistyped subcommand is a usage error with a suggestion; gio build --help. |
v0.1.0-beta.7 | Introduced: prints an explanation; gio build standalone. |