docs/solutions/developer-experience/2026-04-09-slate-workspace-packages-should-have-live-root-source-entries-under-pnp.md
The first failure showed up in slate-hyperscript, but the underlying issue was
broader: workspace package-name imports were leaning on built dist/ entries.
That works until it doesn't.
Under Yarn PnP, once a package root resolves through dead or stale dist/
output, tests and source-time tooling can fail for reasons that have nothing to
do with the actual source package.
Most workspace packages had src/index.ts, but no root index.ts.
That left package-name imports overly dependent on published-entry metadata and prebuilt output even inside the workspace itself.
Use both:
export * from './src'
for:
slateslate-historyslate-reactslate-domslate-browserslate-hyperscriptdist/ when dist/ happens to
existThe root entry gives the workspace a source-resolvable package fallback without changing the real authored module surface.
The Babel alias closes the other half of the trap: if dist/ exists, Node/PnP
can still prefer it. For source-time proof lanes, the alias forces live source.
dist/ cannot silently win.dist/ luck.