{"id":13398078,"url":"https://github.com/browserify/tinyify","last_synced_at":"2025-04-08T18:19:16.991Z","repository":{"id":47183157,"uuid":"106448229","full_name":"browserify/tinyify","owner":"browserify","description":"a browserify plugin that runs various optimizations, so you don't have to install them all manually. makes your bundles tiny!","archived":false,"fork":false,"pushed_at":"2023-04-19T05:07:24.000Z","size":77,"stargazers_count":409,"open_issues_count":8,"forks_count":40,"subscribers_count":7,"default_branch":"default","last_synced_at":"2024-05-15T13:26:06.321Z","etag":null,"topics":["browserify","browserify-plugin","minify","optimize","tree-shaking","uglify"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browserify.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-10-10T17:18:55.000Z","updated_at":"2024-05-14T21:21:40.000Z","dependencies_parsed_at":"2024-01-16T05:40:58.457Z","dependency_job_id":"77be55af-9111-4b6c-97b3-ae41b7732902","html_url":"https://github.com/browserify/tinyify","commit_stats":{"total_commits":66,"total_committers":7,"mean_commits":9.428571428571429,"dds":"0.16666666666666663","last_synced_commit":"38b55a8e1e9612b13cbafafe6560794e6e263d8f"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Ftinyify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Ftinyify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Ftinyify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Ftinyify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserify","download_url":"https://codeload.github.com/browserify/tinyify/tar.gz/refs/heads/default","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247898519,"owners_count":21014722,"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":["browserify","browserify-plugin","minify","optimize","tree-shaking","uglify"],"created_at":"2024-07-30T18:02:05.842Z","updated_at":"2025-04-08T18:19:16.974Z","avatar_url":"https://github.com/browserify.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# tinyify\n\na browserify plugin that runs various optimizations, so you don't have to install them all manually.\n\n[![npm][npm-image]][npm-url]\n[![travis][travis-image]][travis-url]\n[![standard][standard-image]][standard-url]\n\n[npm-image]: https://img.shields.io/npm/v/tinyify.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/tinyify\n[travis-image]: https://img.shields.io/travis/browserify/tinyify.svg?style=flat-square\n[travis-url]: https://travis-ci.org/browserify/tinyify\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[standard-url]: http://npm.im/standard\n\n```bash\nnpm install --save-dev tinyify\n\nbrowserify -p tinyify app.js\n```\n\n## Included\n\n - [unassertify][] - Remove `assert()` calls\n - [@browserify/envify][] - Replace environment variables—by default, replaces `NODE_ENV` with `\"production\"`\n - [@browserify/uglifyify][] - Remove dead code from modules\n - [common-shakeify][] - Remove unused exports from modules\n - [browser-pack-flat][] - Output a \"flat\" bundle, with all modules in a single scope\n - [bundle-collapser][] - When using the `--no-flat` option, bundle-collapser replaces file paths in `require()` calls with short module IDs\n - [minify-stream][] - Uglify the final bundle\n\n[browser-pack-flat][] and [bundle-collapser][] are both not used if the `--full-paths` option is passed to Browserify.\nThis way you can still get all of tinyify's other optimizations when building for [disc][].\n\n## Options\n\nOptions can be provided on the command line using subarg syntax, or in a separate options object using the browserify API.\n\n### `env: {}`\n\nSupply custom environment variables for [@browserify/envify][].\n\n```js\nb.plugin('tinyify', {\n  env: {\n    PUBLIC_PATH: 'https://mywebsite.surge.sh/'\n  }\n})\n```\n\nThis option is only available in the API.\nOn the CLI, you can define environment variables beforehand instead:\n\n```bash\nPUBLIC_PATH=https://mywebsite.surge.sh browserify app.js -p tinyify\n```\n\n### `--no-flat`, `flat: false`\n\nDisable [browser-pack-flat][].\nThis enables [bundle-collapser][] instead which will still shrink the output bundle a bit by replacing file paths with short module IDs.\n\n```bash\nbrowserify app.js -p [ tinyify --no-flat ]\n```\n\n```js\nb.plugin('tinyify', { flat: false })\n```\n\n## More options?\n\nIf you need further customisation, I recommend installing the tools separately instead:\n\n```bash\nnpm install --save-dev unassertify @browserify/envify @browserify/uglifyify common-shakeify browser-pack-flat terser\nbrowserify entry.js \\\n  -g unassertify \\\n  -g @browserify/envify \\\n  -g @browserify/uglifyify \\\n  -p common-shakeify \\\n  -p browser-pack-flat/plugin \\\n| terser -cm \\\n\u003e output.js\n```\n\nOr with the Node API:\n\n```js\nbrowserify('entry.js')\n    .transform('unassertify', { global: true })\n    .transform('@browserify/envify', { global: true })\n    .transform('@browserify/uglifyify', { global: true })\n    .plugin('common-shakeify')\n    .plugin('browser-pack-flat/plugin')\n    .bundle()\n    .pipe(require('minify-stream')({ sourceMap: false }))\n    .pipe(fs.createWriteStream('./output.js'))\n```\n\nAlternatively you can fork this repo and publish it on npm under a scope with your modifications.\n\n## License\n\n[Apache-2.0](./LICENSE.md)\n\n[unassertify]: https://github.com/unassert-js/unassertify\n[@browserify/envify]: https://github.com/browserify/envify\n[@browserify/uglifyify]: https://github.com/browserify/uglifyify\n[common-shakeify]: https://github.com/browserify/common-shakeify\n[browser-pack-flat]: https://github.com/goto-bus-stop/browser-pack-flat\n[bundle-collapser]: https://github.com/substack/bundle-collapser\n[minify-stream]: https://github.com/goto-bus-stop/minify-stream\n[browser-pack]: https://github.com/browserify/browser-pack\n[disc]: https://github.com/hughsk/disc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Ftinyify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserify%2Ftinyify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Ftinyify/lists"}