{"id":13775047,"url":"https://github.com/TrySound/rollup-plugin-uglify","last_synced_at":"2025-05-11T07:31:48.610Z","repository":{"id":55115812,"uuid":"48820882","full_name":"TrySound/rollup-plugin-uglify","owner":"TrySound","description":"Rollup plugin to minify generated bundle","archived":false,"fork":false,"pushed_at":"2023-03-20T12:30:36.000Z","size":290,"stargazers_count":261,"open_issues_count":14,"forks_count":42,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-05T05:03:01.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/TrySound.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-12-30T21:52:33.000Z","updated_at":"2024-10-30T07:33:54.000Z","dependencies_parsed_at":"2024-06-18T12:25:05.525Z","dependency_job_id":"eea5b249-8590-4119-bda6-326f5e62406b","html_url":"https://github.com/TrySound/rollup-plugin-uglify","commit_stats":{"total_commits":81,"total_committers":15,"mean_commits":5.4,"dds":"0.23456790123456794","last_synced_commit":"60df3a9e7f9e8354afa614e40c9cb1a1bf0fefbc"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrySound%2Frollup-plugin-uglify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrySound%2Frollup-plugin-uglify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrySound%2Frollup-plugin-uglify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrySound%2Frollup-plugin-uglify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrySound","download_url":"https://codeload.github.com/TrySound/rollup-plugin-uglify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225027328,"owners_count":17409410,"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:33.196Z","updated_at":"2024-11-17T10:30:26.457Z","avatar_url":"https://github.com/TrySound.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Output"],"readme":"# rollup-plugin-uglify [![Travis Build Status][travis-img]][travis]\n\n[travis-img]: https://travis-ci.org/TrySound/rollup-plugin-uglify.svg\n[travis]: https://travis-ci.org/TrySound/rollup-plugin-uglify\n\n[Rollup](https://github.com/rollup/rollup) plugin to minify generated bundle. Uses [UglifyJS](https://github.com/mishoo/UglifyJS2) under the hood. There are a few improvements over native uglify:\n\n* uglify is run in worker for every chunk\n* errors are displayed with [babel code frame](https://babeljs.io/docs/en/next/babel-code-frame.html)\n\n_Note: uglify-js is able to transpile only es5 syntax. If you want to transpile es6+ syntax use [terser](https://github.com/TrySound/rollup-plugin-terser) instead_\n\n## Install\n\n```sh\nyarn add rollup-plugin-uglify --dev\n```\n\n*Note: this package requires rollup@0.66 and higher*\n\n## Usage\n\n```js\nimport { rollup } from \"rollup\";\nimport { uglify } from \"rollup-plugin-uglify\";\n\nrollup({\n  input: \"main.js\",\n  plugins: [uglify()]\n});\n```\n\n## Options\n\n```js\nuglify(options);\n```\n\n`options` - [uglifyJS API options](https://github.com/mishoo/UglifyJS2/blob/master/README.md#minify-options)\n\n`options.sourcemap: boolean`\n\nGenerates source maps and passes them to rollup. Defaults to `true`.\n\n`options.numWorkers: number`\n\nAmount of workers to spawn. Defaults to the number of CPUs minus 1.\n\n\n## Examples\n\n### Comments\n\nIf you'd like to preserve comments (for licensing for example), then you can specify a function to do this like so:\n\n```js\nuglify({\n  output: {\n    comments: function(node, comment) {\n      if (comment.type === \"comment2\") {\n        // multiline comment\n        return /@preserve|@license|@cc_on/i.test(comment.value);\n      }\n      return false;\n    }\n  }\n});\n```\n\nAlternatively, you can also choose to keep all comments (e.g. if a licensing header has already been prepended by a previous rollup plugin):\n\n```js\nuglify({\n  output: {\n    comments: \"all\"\n  }\n});\n```\n\nSee [UglifyJS documentation](https://github.com/mishoo/UglifyJS2/blob/master/README.md) for further reference.\n\n# License\n\nMIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTrySound%2Frollup-plugin-uglify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTrySound%2Frollup-plugin-uglify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTrySound%2Frollup-plugin-uglify/lists"}