{"id":27351,"library":"rollup-plugin-compat","title":"rollup-plugin-compat","description":"A Rollup plugin that transpiles bundled JavaScript output to an older ECMAScript standard (COMPAT) for legacy browser support. Version 0.22.4 is the latest stable release, but the package appears to be in early development with no README and no clear release cadence. Unlike full-featured transpilers like Babel or SWC, this plugin focuses narrowly on output compatibility, potentially offering faster builds for simple transpilation needs. Its key differentiator is being a Rollup-native solution, avoiding extra tooling configuration, though its capabilities and maintenance are uncertain due to lack of documentation. Recommended for experimental use only.","status":"active","version":"0.22.4","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install rollup-plugin-compat","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-compat","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-compat","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin requires Rollup to function.","package":"rollup","optional":false}],"imports":[{"note":"Default export; the package may not support CommonJS require().","wrong":"const compat = require('rollup-plugin-compat')","symbol":"compat","correct":"import compat from 'rollup-plugin-compat'"},{"note":"Some versions might export named export 'compat' instead of default.","wrong":"import compat from 'rollup-plugin-compat'","symbol":"compat","correct":"import { compat } from 'rollup-plugin-compat'"},{"note":"If using CommonJS, named destructuring may be required if the package exports compat as a named export.","wrong":"const compat = require('rollup-plugin-compat')","symbol":"compat","correct":"const { compat } = require('rollup-plugin-compat')"}],"quickstart":{"code":"import { rollup } from 'rollup';\nimport compat from 'rollup-plugin-compat';\n\nasync function build() {\n  const bundle = await rollup({\n    input: 'src/index.js',\n    plugins: [compat()]\n  });\n  await bundle.write({ file: 'dist/bundle.js', format: 'iife' });\n}\n\nbuild().catch(console.error);","lang":"javascript","description":"Demonstrates basic Rollup build configuration using the compat plugin to transpile output for older browsers."},"warnings":[{"fix":"Review source code or test extensively before using in production.","message":"The package lacks a README and comprehensive documentation; behavior is uncertain.","severity":"gotcha","affected_versions":"all"},{"fix":"Pin to exact version and expect breaking changes on update.","message":"Version 0.22.4 is likely pre-1.0; API may break in minor/patch releases.","severity":"gotcha","affected_versions":"<1.0"},{"fix":"Consider alternatives like @rollup/plugin-babel for production.","message":"No release cadence established; package may be abandoned.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `npm install rollup-plugin-compat --save-dev`","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'rollup-plugin-compat'"},{"fix":"Use `import { compat } from 'rollup-plugin-compat'` or check exports","cause":"Incorrect import style; package may export differently.","error":"TypeError: compat is not a function"},{"fix":"Ensure `compat()` is called (not just reference) in plugins array","cause":"Plugin is not included in rollup.config.js or is not a function.","error":"Error: Unknown plugin 'compat'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}