Registry / devops / tsdown-stale-guard

tsdown-stale-guard

JSON →
library0.1.2jsnpmunverified

Build freshness validation plugin for tsdown that checks if output is stale by comparing hash signatures. Version 0.1.2 (latest) supports tsdown ^0.21.9 or ^0.22.0. Lightweight, zero-config, no external dependencies beyond tsdown. Integrates as a tsdown plugin to ensure builds are not served stale artifacts, commonly used in CI or hot-reload workflows.

npm install tsdown-stale-guard
INSTALL
IMPORT
SIG · TSDOWN-STALE-GUARD
T
tsdown-stale-guard
devopsjavascriptv0.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

staleGuard
import { staleGuard } from 'tsdown-stale-guard'
const staleGuard = require('tsdown-stale-guard')
Named ESM export only; CJS require() is not supported.
Plugin type
import type { Plugin } from 'tsdown-stale-guard'
TypeScript type import; not a value.
default import
import staleGuard from 'tsdown-stale-guard'
import { staleGuard } from 'tsdown-stale-guard' then using as default
Package has both named and default export for staleGuard; both work, but default import is straightforward.

Basic usage: add staleGuard as a tsdown plugin to validate build freshness.

import { defineConfig } from 'tsdown'; import { staleGuard } from 'tsdown-stale-guard'; export default defineConfig({ plugins: [ staleGuard() ] });
Debug
Known issues
gotchaPlugin requires tsdown version ^0.21.9 or ^0.22.0. Using other versions may break.
fix
Update tsdown to ^0.21.9 or ^0.22.0.
affects: <0.21.9 || >0.22.0
gotchaStale guard only works if output files are hashed; ensure tsdown config generates hashed filenames.
fix
Enable hashing in tsdown config (e.g., output.filename with [hash]).
affects: >=0.0.0
gotchaWhen using ESM, default import may not work in some bundlers if they don't support package.json exports field correctly.
fix
Use named import { staleGuard } instead of default import.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'tsdown-stale-guard'
Package not installed or not in node_modules
fix
Run `npm install tsdown-stale-guard` or `yarn add tsdown-stale-guard`.
ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './package.json' is not defined
Importing an internal path that is not exported
fix
Only import from top-level package: `import { staleGuard } from 'tsdown-stale-guard'`.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
tsdownrequiredPeer dependency; plugin runs as part of tsdown build pipeline
Agent activity
2 hits · last 30 days
node
2
Resources
tsdown-stale-guard — npm install tsdown-stale-guard · libregistry