{"id":13774857,"url":"https://github.com/ampproject/rollup-plugin-closure-compiler","last_synced_at":"2025-05-15T04:04:18.150Z","repository":{"id":32775582,"uuid":"139080902","full_name":"ampproject/rollup-plugin-closure-compiler","owner":"ampproject","description":"Leverage Closure Compiler to minify and optimize JavaScript with Rollup.","archived":false,"fork":false,"pushed_at":"2025-05-14T08:30:05.000Z","size":1380,"stargazers_count":292,"open_issues_count":65,"forks_count":27,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-14T09:42:36.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ampproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2018-06-29T00:12:57.000Z","updated_at":"2024-08-02T02:21:27.000Z","dependencies_parsed_at":"2025-04-12T21:28:35.528Z","dependency_job_id":"420fd1fd-4a4c-446e-8886-54d265d336e7","html_url":"https://github.com/ampproject/rollup-plugin-closure-compiler","commit_stats":{"total_commits":369,"total_committers":10,"mean_commits":36.9,"dds":0.5962059620596206,"last_synced_commit":"7ec95e00d7cc08e9fb168e0eb5a3e2ff66a0d5d7"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Frollup-plugin-closure-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Frollup-plugin-closure-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Frollup-plugin-closure-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Frollup-plugin-closure-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ampproject","download_url":"https://codeload.github.com/ampproject/rollup-plugin-closure-compiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254137978,"owners_count":22021020,"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-08-03T17:01:30.984Z","updated_at":"2025-05-15T04:04:17.994Z","avatar_url":"https://github.com/ampproject.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Output"],"readme":"# rollup-plugin-closure-compiler\n\nLeverage [Closure Compiler](https://developers.google.com/closure/compiler/) to minify and optimize JavaScript with [Rollup](https://rollupjs.org/guide/en).\n\nGenerally Closure Compiler will produce superior minification than other projects, but historically has been more difficult to use. The goal of this plugin is to reduce this friction.\n\n## Installation\n\n```bash\nnpm install @ampproject/rollup-plugin-closure-compiler --save-dev\n```\n\n## Usage\n\nInvoke Closure Compiler from your Rollup configuration.\n\n```js\n// rollup.config.js\nimport compiler from '@ampproject/rollup-plugin-closure-compiler';\n\nexport default {\n  input: 'main.js',\n  output: {\n    file: 'bundle.js',\n    format: 'iife',\n  },\n  plugins: [\n    compiler(),\n  ],\n}\n```\n\nIf you would like to provide additional [flags and options](https://github.com/google/closure-compiler/wiki/Flags-and-Options) to Closure Compiler, pass them via key-value pairs.\n\n```js\n// rollup.config.js\nimport compiler from '@ampproject/rollup-plugin-closure-compiler';\n\nexport default {\n  input: 'main.js',\n  output: {\n    file: 'bundle.js',\n    format: 'iife',\n  },\n  plugins: [\n    compiler({\n      formatting: 'PRETTY_PRINT'\n    }),\n  ],\n}\n```\n\n### Automatic Closure Configuration\n\nThis plugin will modify the enable the `assume_function_wrapper` output option for Closure Compiler when `es` format is specifed to Rollup. **Note**: This is overrideable via passed flags and options.\n\n```js\n// rollup.config.js\nimport compiler from '@ampproject/rollup-plugin-closure-compiler';\n\nexport default {\n  input: 'main.js',\n  output: {\n    file: 'bundle.js',\n    format: 'es',\n  },\n  plugins: [\n    compiler(),\n  ],\n}\n```\n\nIf your Rollup configuration outputs an IIFE format bundle with a specified name, this plugin will add an extern to ensure the name does not get mangled. **Note**: This is overrideable via passed flags and options.\n\n```js\n// rollup.config.js\nimport compiler from '@ampproject/rollup-plugin-closure-compiler';\n\nexport default {\n  input: 'main.js',\n  output: {\n    file: 'bundle.js',\n    format: 'iife',\n    name: 'MyAwesomeThing'\n  },\n  plugins: [\n    compiler(),\n  ],\n}\n```\n\n## Security disclosures\n\nThe AMP Project accepts responsible security disclosures through the [Google Application Security program](https://www.google.com/about/appsecurity/).\n\n## Code of conduct\n\nThe AMP Project strives for a positive and growing project community that provides a safe environment for everyone.  All members, committers and volunteers in the community are required to act according to the [code of conduct](.github/CODE_OF_CONDUCT.md).\n\n## License\n\nrollup-plugin-closure-compiler is licensed under the [Apache License, Version 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fampproject%2Frollup-plugin-closure-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fampproject%2Frollup-plugin-closure-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fampproject%2Frollup-plugin-closure-compiler/lists"}