A Rollup plugin that minifies ES6 class member names (fields and methods) by renaming identifiers prefixed with underscore (`_`). Version 2.0.0 requires Node.js >=13. It works alongside standard JavaScript minifiers (like Terser) which cannot rename class properties. The plugin operates on the AST during bundling, replacing `_`-prefixed names with short alternatives. It supports repeated use across multiple bundles with consistent mappings by reusing the plugin instance. Input files must use underscore-prefixed class members for minification to apply.
npm install rollup-plugin-es6-class-minifyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of the plugin with Rollup. Creates a plugin instance and adds it to the plugins array.
Prefix all class fields and methods intended for minification with an underscore, e.g., `_count`, `_increment()`.
Add another minifier plugin like `rollup-plugin-terser` after this plugin in the plugins array.
To maintain cross-bundle consistency, reuse the same plugin instance (as shown in the docs).
Upgrade Node.js to version 13 or higher.
Use import { rollupPluginES6ClassMinify } from 'rollup-plugin-es6-class-minify'const { rollupPluginES6ClassMinify } = require('rollup-plugin-es6-class-minify');Ensure the plugin is included in the 'plugins' array and that your code uses underscore-prefixed class members.