Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

rolldown-plugin-prettier

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rolldown-plugin-prettier

Rolldown plugin for code formatting using Prettier

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
63
90.91%
Maintainers
1
Weekly downloads
 
Created
Source

Rolldown Plugin Prettier

Rolldown plugin that can be used to run Prettier on the final bundle.

Usage

Add the plugin npm install --save-dev rolldown-plugin-prettier, then add it to your rolldown.config.js, for example:

import prettier from "rolldown-plugin-prettier"
// …
export default {
	// …
	plugins: [
		// …
		prettier({
			printWidth: 120,
			tabWidth: 4,
			useTabs: true,
			semi: false,
			trailingComma: "none",
			arrowParens: "avoid",
			experimentalTernaries: true
		})
	]
}

Plugin Options

cwd

  • default: process.cwd()
  • type: string
  • example: prettier({ cwd: "path/to/dir" })
  • purpose: The directory prettier will use to find the local config

sourcemap

  • default: undefined
  • type: "silent"
  • example: prettier({ sourcemap: "silent" })
  • purpose: Set to "silent" to suppress warnings.

If source map is enabled in the global rolldown options, then a source map will be generated on the formatted bundle.

Note that this may take some time since prettier package is not able to generate a sourcemap and this plugin must compute the diff between the original bundle and the formatted result and generate the corresponding sourcemap.

Contributing

If you find a bug or think about enhancement, feel free to contribute and submit an issue or a pull request. See CONTRIBUTING.md.

Credit

Thank you Mickael Jeanroy for making the version of this plugin that this was forked from rollup-plugin-prettier.

Please see LICENSE.

Keywords

rolldown

FAQs

Package last updated on 24 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts