Rollup plugin to format the final bundle with Prettier. Current stable version is 4.1.2, supports Prettier ^1.0.0 || ^2.0.0 || ^3.0.0 and Rollup ^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0. Ships TypeScript types. Key differentiators: integrates Prettier as a Rollup plugin, handles source map generation by computing diffs. Release cadence is irregular, with recent updates focused on dependency upgrades and Rollup/Prettier version support.
npm install rollup-plugin-prettierVerified import paths — ran on the pinned version, not inferred.
Configures Rollup to format output bundle with Prettier using tab width 2 and single quotes.
Install prettier as a devDependency: npm install --save-dev prettier
Upgrade plugin to v4.0.0 or later to use prettier v3
Use sourcemap: true instead of sourceMap: true
Disable source map in plugin options if not needed, or accept slower builds.
No action needed; asynchronous mode prepares for Prettier v3 async API.
Use import prettier from 'rollup-plugin-prettier' (default import) instead of import { prettier } from 'rollup-plugin-prettier'.Run npm install --save-dev prettier to install it.
Run npm install --save-dev rollup-plugin-prettier
Change sourceMap: true to sourcemap: true in plugin options.