Project configuration
Sklair reads sklair.json from the current directory, falling back to src/sklair.json. All configured paths are resolved relative to the directory containing that file.
{
"$schema": "https://github.com/numelon-oss/sklair/releases/latest/download/sklair.schema.json",
"input": ".",
"components": "components",
"layouts": "layouts",
"hooks": {
"enabled": true,
"path": "hooks"
},
"output": "../build",
"templates": ["AudioTier"]
}
Fields
| Field | Type | Default | Description |
|---|---|---|---|
$schema | string | "https://github.com/numelon-oss/sklair/releases/latest/download/sklair.schema.json" | Sklair configuration file schema. This is usually automatically populated with whichever Sklair version created the project. |
input | string | "./src" | The directory where the project's source code is stored. |
components | string | "./components" | The directory where the project's components are stored. |
layouts | string | "./layouts" | The directory where the project's full-document layouts are stored. |
output | string | "./build" | The directory where the built project should be written. |
exclude | string[] | [] | A list of gitignore-style glob patterns that should be excluded from the build process. |
excludeCompile | string[] | [] | A list of gitignore-style glob patterns that should be excluded from the compilation process. |
templates | string[] | [] | Components that compile into native browser templates when used in a document. Sklair Runtime is not included if this field is omitted. |
serve | object | { ... } | Development server options. |
serve.rewrites | object[] | [] | Ordered development-server path rewrites. Generated files take precedence over rewrites. |
hooks | object | { ... } | Sandboxed Lua pre- / post-build hook options. |
hooks.enabled | boolean | false | Whether sandboxed Lua pre- / post-build hooks should be executed. |
hooks.path | string | "hooks" | The directory where pre- / post-build hooks are stored. The directory must contain the directories "pre" and "post". |
hooks.http | object | { ... } | HTTP(s) request options for pre- / post-build hooks. |
hooks.http.httpAllowed | boolean | false | Whether HTTP requests should be allowed in pre- / post-build hooks. |
hooks.http.allowedHosts | string[] | [] | A list of hosts that are allowed to make HTTP(s) requests in pre- / post-build hooks. |
hooks.http.allowedMethods | string[] | [] | A list of methods that are allowed to be used in pre- / post-build hooks. |
hooks.http.maxResponseBytes | integer | 2097152 | The maximum size of a response that can be received from a hook, in bytes. |
hooks.http.timeout | integer | 5000 | The maximum time in milliseconds that a HTTP(s) request within a hook can take to respond. |
hooks.http.followRedirects | boolean | true | Whether HTTP(s) redirects should be followed within a hook. |
hooks.http.maxRedirects | integer | 5 | The maximum number of redirects that can be followed by a HTTP(s) request within a hook. |
preventFOUC | object | { ... } | Options for preventing Flash Of Unstyled Content (FOUC) in the resulting HTML. |
preventFOUC.enabled | boolean | false | Whether Sklair should help prevent Flash Of Unstyled Content (FOUC). |
preventFOUC.colour | string | "#202020" | The colour of the FOUC prevention overlay, shown before the page is fully loaded. |
minify | boolean | false | Whether HTML files should be minified. TODO: feature |
obfuscateJS | object | { ... } | Options reserved for JavaScript obfuscation. TODO: feature. perhaps sklair extensions for both obfuscation and minification; dont include in sklari core |
obfuscateJS.enabled | boolean | false | Whether JavaScript files should be obfuscated. TODO: this is a future feature |
HTML extensions .htm, .html, .shtml, and .xhtml are compiled. Other discovered files are copied. excludeCompile reclassifies matching HTML as a static file; exclude removes a match entirely.
Patterns follow gitignore-style doublestar matching, including ! re-inclusion, leading / anchoring, and directory matching. Sklair also excludes its configuration file, .sklair, Git and common editor metadata, environment files, node_modules, macOS metadata, and configured component, layout, hook, and output directories.
hooks
{
"hooks": {
"enabled": true,
"path": "hooks"
}
}
path defaults to hooks; Sklair discovers .lua files beneath its pre and post directories. The nested hooks.http shape is present in the configuration schema for future HTTP support, but no HTTP module is currently exposed to hooks. Setting those fields does not enable requests.
preventFOUC
{
"preventFOUC": {
"enabled": true,
"colour": "#f5f2ed"
}
}
When enabled, Sklair inserts an early style which hides the document against the configured colour and a body script which reveals it on window load, aiming to prevent a Flash Of Unstyled Content (FOUC). The default colour is #202020.
serve
serve.rewrites is an ordered array of { "from": "request pattern", "to": "/output-file.html" } rules. Both fields are required. Existing output files take precedence, and the first matching rule serves its target for GET and HEAD requests.
This is development-server configuration only. See SPA path rewrites for syntax, examples, and fallback behaviour.