Open
Conversation
…o build output Convert the CLI tool into reusable webpack/rspack plugins that inject ASCII art comment headers (Buddha/Alpaca/Jesus) into bundled JS/CSS assets after minification. - Add lib/BugfreePlugin.js as shared plugin core using processAssets hook - Add webpack-plugin.js and rspack-plugin.js entry points - Add exports field in package.json for `bugfreejs/webpack-plugin` and `bugfreejs/rspack-plugin` - Add examples/webpack-example and examples/rspack-example demo projects - Update .gitignore for dist and package-lock.json https://claude.ai/code/session_01DhV789vGjbbRemZw1LZdN8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds webpack and rspack plugin support to bugfreejs, allowing users to integrate the comment injection functionality directly into their build pipelines. The package now supports both CLI usage and bundler plugins.
Key Changes
lib/BugfreePlugin.js): Core plugin implementation that injects special comments into compiled JS and CSS assets. Supports three comment styles via thefaithoption ('default', 'alpaca', 'god') and can be enabled/disabled.webpack-plugin.jsandrspack-plugin.jsas thin wrappers exporting the core plugin for webpack and rspack respectively.exportsfield for clean subpath imports (bugfreejs/webpack-plugin,bugfreejs/rspack-plugin)filesfield to control published package contents.gitignoreto excludedist/andpackage-lock.jsonImplementation Details
processAssetsstage (SUMMARIZE) to run after minification/optimization//) and CSS (/* */) filescompilation.getAsset()andcompilation.updateAsset()for asset manipulationhttps://claude.ai/code/session_01DhV789vGjbbRemZw1LZdN8