library
library(
options?,limits?):UserConfig
Defined in: library.ts:30
tsdown preset for a published ESM library. Single entry point, generates types, externalizes every dependency.
neverBundle: true externalizes every bare-specifier import, not just
@theholocron/* peers – the narrower regex this used to carry only
ever protected org packages, so a package with real third-party runtime
deps (e.g. google-client’s googleapis/google-auth-library) got them
bundled by default. Confirmed harmless there today only because
rolldown’s tree-shaking happened to strip the unreachable code back out
before final emit – fragile (a future import could reach code that
doesn’t shake away) and slow (~15s vs sub-second for a properly
externalized build).
After every successful build, onSuccess fails it if an emitted bundle is
over 512KB – the symptom of a dependency that failed to externalize
(holocron#762). A caller’s own onSuccess (function or shell command) runs after the check.
A package that inlines other code on purpose (apps/sentinel inlines three workspace packages, holocron#922)
raises its own limit with maxBundleBytes, set a little above its real size so the check still catches an
accidental inline (a dependency adds megabytes) without failing every feature the package grows by.
Parameters
Section titled “Parameters”options?
Section titled “options?”UserConfig = {}
limits?
Section titled “limits?”maxBundleBytes?
Section titled “maxBundleBytes?”number
Returns
Section titled “Returns”UserConfig