@hyperfrontend/builder/package/assetsassets
Generic asset-copy primitive consumed by the package phase.
copyAssets(specs, outputPath, srcPkg) materializes a list of AssetSpec entries into the build output. Each spec selects its inputs via either an explicit files: string[] list or a POSIX-style glob: string evaluated relative to spec.from, and writes them under <outputPath>/<spec.to> (defaulting to the dist root). Specs gated by a condition predicate are skipped when the predicate returns false. Builder ships with zero default-asset knowledge — wrappers supply their own asset spec lists.
API Reference
ƒ Functions
Copies one or more asset specs into the build output directory.
Each spec selects its inputs in one of two ways:
Each spec selects its inputs in one of two ways:
spec.files: explicit list of relative paths underspec.from. Missing entries
spec.glob: POSIX-style glob evaluated relative tospec.from.
<outputPath>/<spec.to>, defaulting to the dist root when spec.to is omitted or equal to '.'. Specs whose condition predicate returns false are skipped entirely.Parameters
Example
Copying README + LICENSE into the dist root
copyAssets(
[
{ from: '/abs/libs/foo', files: ['README.md', 'CHANGELOG.md'] },
{ from: '/abs/repo', files: ['LICENSE.md', 'SECURITY.md'] },
],
'/abs/dist/libs/foo',
srcPkg
)