{"id":13451806,"url":"https://github.com/mjeanroy/rollup-plugin-prettier","last_synced_at":"2025-04-12T14:55:19.102Z","repository":{"id":20571242,"uuid":"90301263","full_name":"mjeanroy/rollup-plugin-prettier","owner":"mjeanroy","description":"Run prettier formatter with rollup","archived":false,"fork":false,"pushed_at":"2025-04-01T09:40:27.000Z","size":1334,"stargazers_count":62,"open_issues_count":1,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T10:32:02.633Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjeanroy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-04T19:18:48.000Z","updated_at":"2025-04-01T09:40:24.000Z","dependencies_parsed_at":"2023-02-18T11:17:40.437Z","dependency_job_id":"97f94355-72e0-4f51-a7c9-076c5dc7d898","html_url":"https://github.com/mjeanroy/rollup-plugin-prettier","commit_stats":{"total_commits":1476,"total_committers":9,"mean_commits":164.0,"dds":0.5311653116531165,"last_synced_commit":"063694ef4d30f8e468a42104b959dbdc21e74df9"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjeanroy%2Frollup-plugin-prettier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjeanroy%2Frollup-plugin-prettier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjeanroy%2Frollup-plugin-prettier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjeanroy%2Frollup-plugin-prettier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjeanroy","download_url":"https://codeload.github.com/mjeanroy/rollup-plugin-prettier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586245,"owners_count":21128995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T07:01:03.200Z","updated_at":"2025-04-12T14:55:19.083Z","avatar_url":"https://github.com/mjeanroy.png","language":"JavaScript","funding_links":[],"categories":["Plugins","JavaScript"],"sub_categories":["Output"],"readme":"# rollup-plugin-prettier\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/mjeanroy/rollup-plugin-prettier.svg)](https://greenkeeper.io/)\n[![Build Status](https://travis-ci.org/mjeanroy/rollup-plugin-prettier.svg?branch=master)](https://travis-ci.org/mjeanroy/rollup-plugin-prettier)\n[![Npm version](https://badge.fury.io/js/rollup-plugin-prettier.svg)](https://badge.fury.io/js/rollup-plugin-prettier)\n\nRollup plugin that can be used to run [prettier](http://npmjs.com/package/prettier) on the final bundle.\n\n## How to use\n\nInstall the plugin with NPM:\n\n`npm install --save-dev prettier rollup-plugin-prettier`\n\nThen add it to your rollup configuration:\n\n```javascript\nconst path = require('path');\nconst prettier = require('rollup-plugin-prettier');\n\nmodule.exports = {\n  input: path.join(__dirname, 'src', 'index.js'),\n\n  output: {\n    file: path.join(__dirname, 'dist', 'bundle.js'),\n  },\n\n  plugins: [\n    // Run plugin with prettier options.\n    prettier({\n      tabWidth: 2,\n      singleQuote: false,\n    }),\n  ],\n};\n```\n\n## Source Maps\n\nIf source map is enabled in the global rollup options, then a source map will be generated on the formatted bundle (except if sourcemap are explicitely disabled in the prettier options).\n\nNote 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: for this reason, sourcemap are disabled by default.\n\nHere is an example:\n\n```javascript\nconst path = require('path');\nconst prettier = require('rollup-plugin-prettier');\n\nmodule.exports = {\n  input: path.join(__dirname, 'src', 'index.js'),\n\n  output: {\n    file: path.join(__dirname, 'dist', 'bundle.js'),\n    sourcemap: true,\n  },\n\n  plugins: [\n    prettier({\n      sourcemap: true, // Can also be disabled/enabled here.\n    }),\n  ],\n};\n```\n\n## ChangeLogs\n\n- 4.1.2\n  - Fix a bug where prettier configuration file were not correctly resolved since `prettier@^3.1.1` (same as [this bug in prettier-vscode](https://github.com/prettier/prettier-vscode/issues/3104), broken since [this commit in prettier](https://github.com/prettier/prettier/pull/15363)).\n  - Dependency upgrades\n- 4.1.1\n  - Fix support rollup for ^4.0.0, that was intended to be introduced in `4.1.0`\n  - Dependency upgrades\n- 4.1.0\n  - ~Support rollup ^4.0.0~\n  - Dependency upgrades\n- 4.0.0\n  - Support prettier ^3.0.0\n  - Dependency upgrades\n- 3.1.0\n  - Reformat asynchrnously to prepare support for prettier ^3.0.0\n- 3.0.0\n  - Support rollup ^3.0.0\n- 2.2.2\n  - Remove IDE files from published package\n- 2.2.1\n  - Fix typings\n  - Dependency updates\n- 2.2.0\n  - Add typings ([#696](https://github.com/mjeanroy/rollup-plugin-prettier/pull/696), thanks [@pastelmind](https://github.com/pastelmind)!)\n  - Dependency updates\n- 2.1.0\n  - Add option to not log warning due to heavy diff computation ([#435](https://github.com/mjeanroy/rollup-plugin-prettier/pull/435))\n  - Dependency updates\n- 2.0.0\n  - Support node \u003e= 10 (still support node \u003e= 6, but it not tested anymore).\n  - Update dev dependencies.\n- 1.0.0\n  - **Breaking Change**: `prettier` dependency is now a peer dependency instead of a \"direct\" dependency: user of the plugin can choose to use prettier 1.x.x or prettier 2.x.x (note that this plugin should be compatible with all versions of prettier).\n  - Support node \u003e= 6.\n  - Support rollup \u003e= 1.0.0\n  - Remove support of deprecated option (`sourceMap` was deprecated in favor of `sourcemap`).\n- 0.7.0\n  - Dependency updates.\n  - Update rollup peer dependency version.\n- 0.6.0\n  - Add support for rollup \u003e= 1 (thanks to [@Andarist](https://github.com/Andarist), see [#211](https://github.com/mjeanroy/rollup-plugin-prettier/pull/211))\n  - Various dependency updates.\n- 0.5.0\n  - Support resolution of prettier config file (see [#195](https://github.com/mjeanroy/rollup-plugin-prettier/issues/195)).\n  - Various dependency updates.\n- 0.4.0\n  - Add compatibility with rollup \u003e= 0.53 with output `sourcemap` option (see [rollup #1583](https://github.com/rollup/rollup/issues/1583)).\n  - Avoid side-effect and do not change the plugin options (see [032be5](https://github.com/mjeanroy/rollup-plugin-prettier/commit/032be56317ab83cd87c2460f1dadc05a617c0d12)).\n  - Various dependency updates.\n- 0.3.0\n  - Support new `sourcemap` (lowercase) option of rollup.\n  - Sourcemap can now be activated/disabled in the plugin options.\n- 0.2.0\n  - Dependency update (`magic-string`)\n- 0.1.0 First release\n\n## License\n\nMIT License (MIT)\n\n## Contributing\n\nIf you find a bug or think about enhancement, feel free to contribute and submit an issue or a pull request.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjeanroy%2Frollup-plugin-prettier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjeanroy%2Frollup-plugin-prettier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjeanroy%2Frollup-plugin-prettier/lists"}