{"library":"rollup-plugin-preserve-use-client","title":"rollup-plugin-preserve-use-client","description":"A Rollup plugin to preserve the 'use client' directive in React 18 components during bundling, ensuring proper separation between server and client components. Current stable version is 3.0.1, released under MIT, with ESM and CJS support and TypeScript type definitions. Unlike alternatives like rollup-plugin-preserve-directives, this plugin does not require 'preserveModules: true', avoiding conflicts with CSS module imports. The plugin uses Rollup's moduleParsed hook (v3.0.0+) and targets Rollup ^4.0.0 as a peer dependency. It solves a specific pain point for library authors distributing npm packages with both server and client components.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-preserve-use-client"],"cli":null},"imports":["import preserveUseClientDirective from 'rollup-plugin-preserve-use-client'","const preserveUseClientDirective = require('rollup-plugin-preserve-use-client')","import type { PreserveUseClientOptions } from 'rollup-plugin-preserve-use-client'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import preserveUseClientDirective from 'rollup-plugin-preserve-use-client';\nimport { defineConfig } from 'rollup';\n\nexport default defineConfig({\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'esm',\n  },\n  plugins: [\n    preserveUseClientDirective(),\n  ],\n});","lang":"typescript","description":"Basic Rollup configuration using ESM imports. Adds the plugin to preserve 'use client' directives in bundled output.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}