{"id":13492781,"url":"https://github.com/TrySound/rollup-plugin-size-snapshot","last_synced_at":"2025-03-28T10:32:57.294Z","repository":{"id":30789639,"uuid":"126004535","full_name":"TrySound/rollup-plugin-size-snapshot","owner":"TrySound","description":"Track your library bundles size and its treeshakability with less effort","archived":false,"fork":false,"pushed_at":"2023-01-06T01:51:42.000Z","size":1231,"stargazers_count":162,"open_issues_count":28,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-14T14:41:43.926Z","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}},"created_at":"2018-03-20T11:05:06.000Z","updated_at":"2023-07-29T10:21:20.000Z","dependencies_parsed_at":"2023-01-14T17:41:04.090Z","dependency_job_id":null,"html_url":"https://github.com/TrySound/rollup-plugin-size-snapshot","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrySound%2Frollup-plugin-size-snapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrySound%2Frollup-plugin-size-snapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrySound%2Frollup-plugin-size-snapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrySound%2Frollup-plugin-size-snapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrySound","download_url":"https://codeload.github.com/TrySound/rollup-plugin-size-snapshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246012783,"owners_count":20709513,"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-31T19:01:09.123Z","updated_at":"2025-03-28T10:32:56.910Z","avatar_url":"https://github.com/TrySound.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Build Tools to set up performance budget","Plugins"],"sub_categories":["All-Purpose Awesome"],"readme":"# rollup-plugin-size-snapshot [![Build Status][travis-img]][travis]\n\n[travis-img]: https://travis-ci.org/TrySound/rollup-plugin-size-snapshot.svg\n[travis]: https://travis-ci.org/TrySound/rollup-plugin-size-snapshot\n\n\u003cimg src=\"example2.png\" /\u003e\n\nThis plugin provides details about\n\n- actual bundle size (bundler parsing size)\n- minified bundle size (browser parsing size)\n- gzipped bundle size (download size)\n\nAll of these sizes are important criteria when choosing a library, and they will be stored in the `.size-snapshot.json` file.\n\nThere is also a nice feature for the `es` output format which provides sizes of treeshaked bundles with both rollup and webpack, so if your library has more than one independent parts, you can track that users will not consume dead code. Such bundles entry point looks like this\n\n```js\n// nothing is imported here so nothing should go in user bundle\nimport {} from \"library\";\n```\n\n## Why bundle with rollup\n\n- internals are hidden so you shouldn't worry that user reuses your frequently updated modules\n- faster user bundling if library has a lot of modules\n- predictable and more efficient scope hoisting and as a result more predictable size\n- easier to work without sourcemaps with vendors since development bundlers add a lot of unreadable stuff in module definition\n\n## Usage\n\n```js\nimport { sizeSnapshot } from \"rollup-plugin-size-snapshot\";\n\nexport default {\n  input: \"src/index.js\",\n  output: {\n    file: \"dist/index.js\",\n    format: \"es\",\n  },\n  plugins: [sizeSnapshot()],\n};\n```\n\nIf you use uglify or terser plugins, then make sure they are placed after this one.\n\n```js\nimport { uglify } from \"rollup-plugin-uglify\";\n// or import { terser } from \"rollup-plugin-terser\";\nimport { sizeSnapshot } from \"rollup-plugin-size-snapshot\";\n\nexport default {\n  // ...\n  plugins: [sizeSnapshot(), uglify({ toplevel: true })],\n};\n```\n\n## Options\n\n### snapshotPath\n\ntype: `string`  \ndefault: `'.size-snapshot.json'`\n\n### matchSnapshot\n\nThis option allows you to verify that contributors don't forget to build or commit the `.size-snapshot.json` file. If this is `true`, the plugin will validate the snapshot against an existing one. Typically, one would define this option's value as true during continuous integration; [using it locally is unintended](https://github.com/TrySound/rollup-plugin-size-snapshot/issues/33).\n\ntype: `boolean`  \ndefault: `false`\n\n### threshold\n\nPossible difference between sizes in actual snapshot and generated one.\n\nNote: Make sense only when `matchSnapshot` is `true`.\n\ntype: `number`  \ndefault: `0`\n\n### printInfo\n\nAllows you to disable log to terminal.\n\ntype: `boolean`  \ndefault: `true`\n\n# License\n\nMIT \u0026copy; [Bogdan Chadkin](mailto:trysound@yandex.ru)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTrySound%2Frollup-plugin-size-snapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTrySound%2Frollup-plugin-size-snapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTrySound%2Frollup-plugin-size-snapshot/lists"}