A Node.js custom loader framework with a Rollup-like plugin interface (v0.9.0). Requires Node.js >=22.18.0. Provides synchronous hooks (options, resolveId, load, transform) for developing loaders such as TypeScript or Oxc loaders. Supports ESM and CJS, virtual modules, and source maps. Breaking changes in v0.9.0 removed module.register and async/worker support. Integrates with unplugin. Less feature-rich than tsx but offers a familiar plugin system for Rollup developers.
npm install unloaderVerified import paths — ran on the pinned version, not inferred.
Creates a minimal unloader plugin with resolveId and load hooks for a virtual module.
Rewrite any async or promise-based plugin hooks to be synchronous. Use sync versions of file I/O, etc.
Upgrade Node.js to v22.18.0 or above.
In buildStart and other hooks, access meta via 'this.meta', error via 'this.error', etc.
Upgrade to Node.js >=20.19 or use an older version of unloader.
Use function() { ... } instead of arrow functions for hooks, or capture context via second argument (resolveId receives context as third argument before v0.7? Actually resolveId uses 'this' as context; ensure you are using normal function, not arrow, to have correct 'this'.Make the hook synchronous; use readFileSync, not readFile.
Check that resolveId returns a valid absolute path or an object with id, or returns undefined to let default resolver handle.