{"library":"rollup-plugin-cleanup","title":"rollup-plugin-cleanup","description":"Rollup plugin for removing JavaScript comments, compacting empty lines, trimming trailing spaces, and normalizing line endings. Current stable version 3.2.1 supports Rollup >=2.0 and Node.js >=10.14.2 or >=12.0.0. Unlike minifiers like Uglify, it preserves coding style and gives fine-grained control over comment removal via configurable filters. Since v3.1, it no longer depends on acorn, relying instead on js-cleanup. Offers TypeScript definitions, sourcemap support, and works with JS-like files (TS, Flow, React, ES9+).","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-cleanup"],"cli":null},"imports":["import cleanup from 'rollup-plugin-cleanup'","const cleanup = require('rollup-plugin-cleanup')","import type { RollupPluginCleanupOptions } from 'rollup-plugin-cleanup'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import cleanup from 'rollup-plugin-cleanup';\nimport { rollup } from 'rollup';\nimport nodeResolve from '@rollup/plugin-node-resolve';\n\n(async () => {\n  const bundle = await rollup({\n    input: 'src/index.js',\n    plugins: [\n      nodeResolve(),\n      cleanup({\n        comments: 'some',          // keep some comments (default)\n        compactComments: false,    // preserve whitespace in multiline comments\n        maxEmptyLines: 1,          // allow at most 1 empty line\n        lineEndings: 'unix',       // normalize to Unix line endings\n        extensions: ['js', 'jsx'], // only process these file types\n        sourcemap: true            // generate sourcemap\n      })\n    ]\n  });\n  await bundle.write({ file: 'dist/bundle.js', format: 'esm' });\n})();","lang":"typescript","description":"Shows typical usage with Rollup: import cleanup plugin, apply with common options, and bundle.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}