Documentation
¶
Overview ¶
Package include provides the `@include "file.nflow"` directive. The referenced file is preprocessed recursively in the caller's context (cycle detection uses the include chain), and its pipelines, declarations, and require block are merged into the parent's meta.
Typical use:
@include ./shared/child.nflow
Index ¶
Constants ¶
const ID = "include"
Variables ¶
var Directive = core.Directive{
Name: "include",
Example: `@include "shared/child.nflow"`,
Handler: handleDirective,
}
Directive parses `@include "path"` and merges the referenced file's meta into the parent. Path resolution is relative to the including file's directory.
After merging meta, it applies the merged compile-time constants (`${ns.key}` references from `@const` and `@const.load`) to the parent's own source lines below the @include. Without this step the constants live in meta but never reach the parent's text, so a `@require { url: "${env.X}" }` after the @include would ship the literal `${env.X}` to the bundle resolver.
Functions ¶
Types ¶
This section is empty.