An esbuild plugin that ensures directives like 'use client' and 'use strict' are preserved at the top of output files. Current stable version is 0.0.11. The plugin scans source files for specified directives before bundling and reinserts them into the corresponding output chunks. It supports regex-based include/exclude patterns and works with esbuild's metafile option for improved accuracy. Updated frequently with community contributions, it is primarily used with React Server Components and Node.js ESM/CJS builds. Key differentiator: it handles directives that esbuild would otherwise strip, with minimal overhead.
No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This package only exports a named export, not a default export.
Options type is exported as a type-only export; use 'import type' for type-checking.
CommonJS require must destructure the named export.
Shows how to use the plugin with esbuild, including metafile option for accuracy.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.