sneferu build
Compile and package a theme into a .sneferu.json artifact. Usage, options, output, exit codes and errors.
On this page
Compile and package a theme into a .sneferu.json artifact.
Runs the same checks as validate and, when there are no errors, writes <id>-<version>.sneferu.json and the theme's image assets to the output folder. The artifact is what Hekana loads. Only dist is skipped when the folder is checked, so an --out folder with another name inside the theme makes the next validate or build report SN3003 for its files.
Usage
sneferu build [options] [dir]Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
dir | no | . | Theme folder. |
Options
| Option | Default | Description |
|---|---|---|
--out <dir> | dist | Output folder, relative to the theme folder. |
Examples
sneferu buildBuilds the current folder into ./dist.
sneferu build my-theme --out ../outWrites the artifact next to the theme, outside it.
Output
sneferu build my-theme (exit 0): The hash is the content hash of the artifact; yours will match for an unchanged starter at the same SDK version.
✔ built [email protected] → ./my-theme/dist/my-theme-0.1.0.sneferu.json (hash 21658eb137411586)sneferu build my-theme (exit 1): With the same broken snippet as in validate.
snippets/demo.snf:1:1 error SN2001 <script> is not allowed in themes
snippets/demo.snf:2:4 error SN2002 attribute 'onclick' is not allowed
snippets/demo.snf:3:1 warning SN2015 <img> without width and height; set both so the page does not jump while the image loads
✖ build failedExit codes
| Code | Meaning |
|---|---|
0 | The artifact was written. |
1 | The theme has errors; nothing was written. |
Common errors
<path> error SN3003 file type or location not allowed: 'out/...'
A build output folder other than dist was left inside the theme folder. Delete it, or build with --out pointing outside the theme. See SN3003.
