@hyperfrontend/builder/bundle/entriesentries
Entry-point discovery, resolution, and platform filtering primitives.
discoverEntries(projectRoot) scans <projectRoot>/src for the root index.ts plus every nested directory containing an index.ts, classifying the result into one of root, platform, feature, hybrid, or complex. resolveEntries(config, discovered) filters that list by the format-level entry and exclude patterns (exact subpaths or globs). getEntriesByPlatform(discovery, platform) and getSharedEntries(discovery) partition discovered entries by their platform hint for callers that target a specific runtime.
API Reference
ƒ Functions
Discovers every entry point exposed by a library project.
Scans
Scans
<projectRoot>/src for the root index.ts plus every nested directory containing an index.ts. Recognized layouts include: src/index.ts— root entrysrc/browser/index.ts,src/node/index.ts— platform entriessrc/<feature>/index.ts— feature entriessrc/<platform>/<feature>/index.ts— nested entries (max depth 3)
Parameters
| Name | Type | Description |
|---|---|---|
§projectRoot | string | Absolute path to the project root. |
Returns
EntryPointDiscoveryDiscovery result containing every entry point with its layout category.
Example
Discovering entries for a barrel library
const discovery = discoverEntries('/abs/path/to/libs/utils')
discovery.category // => 'feature' | 'platform' | 'hybrid' | ...
discovery.entryPoints // => [{ exportPath: '.', ... }, ...]§function
getEntriesByPlatform(discovery: EntryPointDiscovery, platform: EntryPointPlatform): EntryPoint[]
Returns the entry points belonging to the requested platform.
Parameters
Returns
EntryPoint[]Subset of
discovery.entryPoints flagged with the matching platform.Example
Retrieving browser entries
const browserEntries = getEntriesByPlatform(discovery, 'browser')Filters discovered entry points using a
Patterns may be exact subpaths (
FormatEntryConfig's entry and exclude patterns. Patterns may be exact subpaths (
./browser), globs (./browser/*), or arrays of either. When entry is omitted every discovered entry is considered, then exclude removes matches.Parameters
Returns
EntryPoint[]Filtered entry points in their original order.
Example
Selecting only browser entries
resolveEntries({ entry: './browser/*' }, discovery.entryPoints)