Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add esbuild-plugin-preserve-directives #193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Seojunhwan
Copy link

PR Description: Add esbuild-plugin-preserve-directives to README

This PR adds the esbuild-plugin-preserve-directives plugin to the "Other plugins" section of the README.md file.

Plugin Description

esbuild-plugin-preserve-directives: A plugin that preserves directives like 'use client' in specified chunks, maintaining them where originally placed, unlike esbuild's banner API which adds to all files.

Why This Plugin is Important

  1. Problem Solved: By default, esbuild removes directives like 'use client' when building chunks. This plugin solves that issue by preserving these crucial directives.

  2. Improvement over Banner API: While esbuild's banner API can add directives, it does so for all files indiscriminately. This plugin offers a more targeted approach.

  3. Efficiency: It allows developers to maintain directives only where necessary, avoiding the overhead of adding them to every file.

  4. Framework Compatibility: Ensures compatibility with frameworks like Next.js that rely on these directives for proper functionality.

Changes Made

  • Added the plugin description to the "Other plugins (hosted on npm)" section of README.md.

Checklist

  • Added new plugin information to README.md
  • Placed in correct alphabetical order
  • Verified the link is working correctly
  • Reviewed the description for accuracy and clarity

This addition will help esbuild users more effectively manage framework-specific directives in their projects, improving build output quality and maintaining crucial runtime behaviors.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant