Skip to content

SourceDirectory context

Always provided by <Output>useContext(SourceDirectoryContext) is never undefined inside an <Output> tree. At the root of the tree, path equals the basePath prop on <Output> (default "./"); nested <SourceDirectory> components update path relative to their parent.

const SourceDirectoryContext: ComponentContext<SourceDirectoryContext>
const myContext = useContext(SourceDirectoryContext);
addContent(content: SourceDirectoryContext | SourceFileContext | CopyFileContext) => void
contents(SourceDirectory context interface | SourceFile context interface | CopyFileContext)[]
pathstring