{"id":13393850,"url":"https://github.com/stephencookdev/speed-measure-webpack-plugin","last_synced_at":"2025-05-13T20:17:15.078Z","repository":{"id":42056219,"uuid":"119157581","full_name":"stephencookdev/speed-measure-webpack-plugin","owner":"stephencookdev","description":"⏱ See how fast (or not) your plugins and loaders are, so you can optimise your builds","archived":false,"fork":false,"pushed_at":"2023-07-20T08:06:39.000Z","size":2029,"stargazers_count":2440,"open_issues_count":76,"forks_count":79,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-28T11:51:19.346Z","etag":null,"topics":["measure","plugin","speed","stats","timer","webpack"],"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/stephencookdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2018-01-27T11:19:00.000Z","updated_at":"2025-04-25T07:45:30.000Z","dependencies_parsed_at":"2024-06-18T11:09:24.768Z","dependency_job_id":"17ed1ae5-c802-4ffb-aec2-4cc9eeda049c","html_url":"https://github.com/stephencookdev/speed-measure-webpack-plugin","commit_stats":{"total_commits":100,"total_committers":15,"mean_commits":6.666666666666667,"dds":"0.20999999999999996","last_synced_commit":"ca66781752e4d11a0730a444b7c21947a569cd1b"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephencookdev%2Fspeed-measure-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephencookdev%2Fspeed-measure-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephencookdev%2Fspeed-measure-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephencookdev%2Fspeed-measure-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephencookdev","download_url":"https://codeload.github.com/stephencookdev/speed-measure-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020654,"owners_count":22000757,"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":["measure","plugin","speed","stats","timer","webpack"],"created_at":"2024-07-30T17:01:01.341Z","updated_at":"2025-05-13T20:17:15.061Z","avatar_url":"https://github.com/stephencookdev.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","打包工具","webpack loader plugin","目录","Webpack"],"sub_categories":["webpack 辅助工具、Loader 和插件","调试"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"120\" height=\"120\" src=\"https://rawgit.com/stephencookdev/speed-measure-webpack-plugin/master/logo.svg\" /\u003e\n  \u003ch1\u003e\n    Speed Measure Plugin\n    \u003cdiv\u003e\u003csup\u003e\u003cem\u003e(for webpack)\u003c/em\u003e\u003c/sup\u003e\u003c/div\u003e\n  \u003c/h1\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START --\u003e\n\n\u003ca href=\"https://travis-ci.org/stephencookdev/speed-measure-webpack-plugin\"\u003e\u003cimg src=\"https://travis-ci.org/stephencookdev/speed-measure-webpack-plugin.svg?branch=master\" /\u003e\u003c/a\u003e \u003ca href=\"https://npmjs.com/package/speed-measure-webpack-plugin\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/speed-measure-webpack-plugin.svg\" /\u003e\u003c/a\u003e \u003ca href=\"https://npmjs.com/package/speed-measure-webpack-plugin\"\u003e\u003cimg src=\"https://img.shields.io/node/v/speed-measure-webpack-plugin.svg\" /\u003e\u003c/a\u003e \u003ca href=\"https://github.com/prettier/prettier\"\u003e\u003cimg src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg\" /\u003e\u003c/a\u003e \u003ca href=\"#contributors\"\u003e\u003cimg src=\"https://img.shields.io/badge/all_contributors-10-orange.svg\" /\u003e\u003c/a\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n\u003c/div\u003e\n\u003cbr\u003e\n\nThe first step to optimising your webpack build speed, is to know where to focus your attention.\n\nThis plugin measures your webpack build speed, giving an output like this:\n\n![Preview of Speed Measure Plugin's output](preview.png)\n\n## Install\n\n```bash\nnpm install --save-dev speed-measure-webpack-plugin\n```\n\nor\n\n```bash\nyarn add -D speed-measure-webpack-plugin\n```\n\n## Requirements\n\nSMP requires at least **Node v6**. But otherwise, accepts **all webpack** versions (1, 2, 3, and 4).\n\n## Usage\n\nChange your webpack config from\n\n```javascript\nconst webpackConfig = {\n  plugins: [new MyPlugin(), new MyOtherPlugin()],\n};\n```\n\nto\n\n```javascript\nconst SpeedMeasurePlugin = require(\"speed-measure-webpack-plugin\");\n\nconst smp = new SpeedMeasurePlugin();\n\nconst webpackConfig = smp.wrap({\n  plugins: [new MyPlugin(), new MyOtherPlugin()],\n});\n```\n\nand you're done! SMP will now be printing timing output to the console by default.\n\nCheck out the [examples folder](/examples) for some more examples.\n\n## Options\n\nPass these into the constructor, as an object:\n\n```javascript\nconst smp = new SpeedMeasurePlugin(options);\n```\n\n### `options.disable`\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nIf truthy, this plugin does nothing at all.\n\n`{ disable: !process.env.MEASURE }` allows opt-in measurements with `MEASURE=true npm run build`.\n\n### `options.outputFormat`\n\nType: `String|Function`\u003cbr\u003e\nDefault: `\"human\"`\n\nDetermines in what format this plugin prints its measurements\n\n- `\"json\"` - produces a JSON blob\n- `\"human\"` - produces a human readable output\n- `\"humanVerbose\"` - produces a more verbose version of the human readable output\n- If a function, it will call the function with the JSON blob, and output the response\n\n### `options.outputTarget`\n\nType: `String|Function`\u003cbr\u003e\nDefault: `console.log`\n\n- If a string, it specifies the path to a file to output to.\n- If a function, it will call the function with the output as the first parameter\n\n### `options.pluginNames`\n\nType: `Object`\u003cbr\u003e\nDefault: `{}`\n\nBy default, SMP derives plugin names through `plugin.constructor.name`. For some\nplugins this doesn't work (or you may want to override this default). This option\ntakes an object of `pluginName: PluginConstructor`, e.g.\n\n```javascript\nconst uglify = new UglifyJSPlugin();\nconst smp = new SpeedMeasurePlugin({\n  pluginNames: {\n    customUglifyName: uglify,\n  },\n});\n\nconst webpackConfig = smp.wrap({\n  plugins: [uglify],\n});\n```\n\n### `options.loaderTopFiles`\n\nType: `Number`\u003cbr\u003e\nDefault: `0`\n\nYou can configure SMP to include the files that take the most time per loader, when using `outputFormat: 'humanVerbose'`. E.g., to show the top 10 files per loader:\n\n```javascript\nconst smp = new SpeedMeasurePlugin({\n  outputFormat: \"humanVerbose\",\n  loaderTopFiles: 10,\n});\n```\n\n### `options.compareLoadersBuild`\n\nType: `Object`\u003cbr\u003e\nDefault: `{}`\n\nThis option gives you a comparison over time of the module count and time spent, per loader. This option provides more data when `outputFormat: \"humanVerbose\"`.\n\nGiven a required `filePath` to store the build information, this option allows you to compare differences to your codebase over time. E.g.\n\n```javascript\nconst smp = new SpeedMeasurePlugin({\n  compareLoadersBuild: {\n    filePath: \"./buildInfo.json\",\n  },\n});\n```\n\n### `options.granularLoaderData` _(experimental)_\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nBy default, SMP measures loaders in groups. If truthy, this plugin will give per-loader timing information.\n\nThis flag is _experimental_. Some loaders will have inaccurate results:\n\n- loaders using separate processes (e.g. `thread-loader`)\n- loaders emitting file output (e.g. `file-loader`)\n\nWe will find solutions to these issues before removing the _(experimental)_ flag on this option.\n\n## FAQ\n\n### What does general output time mean?\n\nThis tends to be down to webpack reading in from the file-system, but in general it's anything outside of what SMP can actually measure.\n\n### What does modules without loaders mean?\n\nIt means vanilla JS files, which webpack can handle out of the box.\n\n## Contributing\n\nContributors are welcome! 😊\n\nPlease check out the [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Migrating\n\nSMP follows [semver](https://semver.org/). If upgrading a major version, you can consult [the migration guide](./migration.md).\n\n## License\n\n[MIT](/LICENSE)\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://stephencookdev.co.uk/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/8496655?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eStephen Cook\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=stephencookdev\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=stephencookdev\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#blog-stephencookdev\" title=\"Blogposts\"\u003e📝\u003c/a\u003e \u003ca href=\"#design-stephencookdev\" title=\"Design\"\u003e🎨\u003c/a\u003e \u003ca href=\"#question-stephencookdev\" title=\"Answering Questions\"\u003e💬\u003c/a\u003e \u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/pulls?q=is%3Apr+reviewed-by%3Astephencookdev\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://scarletsky.github.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2386165?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003escarletsky\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=scarletsky\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/wayou\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/3783096?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e牛さん\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=wayou\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3Awayou\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/ThomasHarper\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/3199791?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eThomas Bentkowski\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=ThomasHarper\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/alan-agius4\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/17563226?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAlan Agius\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=alan-agius4\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3Aalan-agius4\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://daix.me/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1396511?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eXiming\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=NdYAG\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3ANdYAG\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://twitter.com/lihautan\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2338632?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTan Li Hau\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=tanhauhau\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3Atanhauhau\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=tanhauhau\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/ZauberNerd\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/249542?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBjörn Brauer\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=ZauberNerd\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3AZauberNerd\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/The-Only-Matrix\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/61681157?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSuraj Patel\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=The-Only-Matrix\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/hanzooo\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/16368939?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJm\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=hanzooo\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3Ahanzooo\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=hanzooo\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephencookdev%2Fspeed-measure-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephencookdev%2Fspeed-measure-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephencookdev%2Fspeed-measure-webpack-plugin/lists"}