rollup-plugin-preserve-directives

JSON →
library 0.4.0 ·javascript
verified Apr 27, 2026

A Rollup plugin that preserves file-level directives (e.g., 'use client', 'use server') when using preserveModules: true. Version 0.4.0 is the current stable release, with a simple API and minimal configuration. Unlike bundling, where directives are meaningless per file, this plugin ensures each preserved module retains its directives, enabling patterns like React Server Components without separate entrypoints. Still considered early-stage (largely untested) but functional. Filters via include/exclude globs. Warning suppression options exist. Supports Rollup 2–4. Ships TypeScript types.

total hits 12
actors 4 distinct systems
last hit 1d ago AhrefsBot
GPTBot
5
ClaudeBot
1
Search engines
2
Humans
1

top countries 🇺🇸 United States · 🇬🇧 United Kingdom · 🇨🇦 Canada