{"name":"speed-measure-webpack-plugin","version":"1.6.0","description":"Measure + analyse the speed of your webpack loaders and plugins","main":"index.js","scripts":{"prepare":"husky","test":"bun test","ci":"bun run test && bun run functional-test && bun run documentation-test && bun run lint","functional-test":"bun scripts/run-setups.js full-test --install","audit-fix":"bun audit","documentation-test":"alex ./*.md && write-good --no-adverb ./*.md","lint":"prettier --check \"*.{js,json,css,md}\"","fixlint":"prettier --write \"*.{js,json,css,md}\"","ac":"bun x all-contributors-cli"},"repository":{"type":"git","url":"git+https://github.com/stephencookdev/speed-measure-webpack-plugin.git"},"author":{"name":"Stephen Cook","email":"stephen@stephencookdev.co.uk"},"license":"MIT","packageManager":"bun@1.3.8","bugs":{"url":"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues"},"homepage":"https://github.com/stephencookdev/speed-measure-webpack-plugin#readme","engines":{"node":">=6.0.0"},"devEngines":{"runtime":{"name":"node","version":">=18","onFail":"error"}},"peerDependencies":{"webpack":"^1 || ^2 || ^3 || ^4 || ^5"},"devDependencies":{"alex":"^11.0.1","husky":"^9.1.7","lint-staged":"^10.0.8","prettier":"^2.2.1","write-good":"^1.0.2"},"dependencies":{"chalk":"^4.1.0"},"gitHead":"ed4e60f5370b347657af47cdb45aa089ada58dff","_id":"speed-measure-webpack-plugin@1.6.0","_nodeVersion":"25.5.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-hz09hUQeP74zHZOLtSJwpVsuLy8EWxuyGiMVZ2tuvIQcMlL5mGrmbe8RKvrVV5geRkxms9JusQuIBt0UnB0XFw==","shasum":"966eb778cc392a1a984e4145cbaf3002a0e0785b","tarball":"http://registry-npm.ywwl.com/speed-measure-webpack-plugin/download/speed-measure-webpack-plugin-1.6.0.tgz","fileCount":24,"unpackedSize":368684,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCP/sqGbzRgYf+KjBW7FT/wpDxuGySPzHBvXvKDRXAAxAIgCUA0CJGcM4i8310L/81tvmLCEOWWzE4G5MBOcRbJzok="}],"size":235159,"noattachment":false,"key":"/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.6.0.tgz"},"_npmUser":{"name":"stephencookdev","email":"stephen@stephencookdev.co.uk"},"directories":{},"maintainers":[{"name":"stephencookdev","email":"stephen@stephencookdev.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/speed-measure-webpack-plugin_1.6.0_1774367265498_0.8020515339394421"},"_hasShrinkwrap":false,"readme":"<div align=\"center\">\n  <img width=\"120\" height=\"120\" src=\"https://raw.githubusercontent.com/stephencookdev/speed-measure-webpack-plugin/refs/heads/master/logo.svg\" />\n  <h1>\n    Speed Measure Plugin\n    <div><sup><em>(for webpack)</em></sup></div>\n  </h1>\n  <p>\n    <a href=\"https://18ways.com\">Proudly maintained and developed by the team at <strong>18ways</strong></a>.<br />\n    <sub>AI-powered runtime localisation and i18n infrastructure.</sub>\n  </p>\n\n<a href=\"https://18ways.com\"><img alt=\"18ways Logo\" src=\"https://img.shields.io/badge/MADE%20BY%2018ways-119955.svg?style=for-the-badge&logo=18ways&labelColor=119955\"></a>\n<a href=\"https://npmjs.com/package/speed-measure-webpack-plugin\"><img src=\"https://img.shields.io/npm/dw/speed-measure-webpack-plugin.svg?style=for-the-badge\" /></a> <a href=\"https://npmjs.com/package/speed-measure-webpack-plugin\"><img src=\"https://img.shields.io/node/v/speed-measure-webpack-plugin.svg?style=for-the-badge\" /></a>\n\n</div>\n<br>\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, 4, and 5).\n\nTo work on the repository itself and run the test suite, use **Node v18+**.\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`<br>\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`<br>\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`<br>\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`<br>\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.excludedPlugins`\n\nType: `Array<String|Function|RegExp>`<br>\nDefault: `[]`\n\nExcludes plugins from SMP's proxy wrapping. Entries can be:\n\n- a plugin name\n- a plugin constructor\n- a regular expression matched against plugin names\n\nName matching checks both `options.pluginNames` aliases and constructor names. E.g.\n\n```javascript\nconst smp = new SpeedMeasurePlugin({\n  pluginNames: {\n    customReactRefresh: reactRefreshPlugin,\n  },\n  excludedPlugins: [\n    \"customReactRefresh\",\n    MiniCssExtractPlugin,\n    /SomeLegacyPlugin$/,\n  ],\n});\n```\n\n### `options.loaderTopFiles`\n\nType: `Number`<br>\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`<br>\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`<br>\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### `options.excludedLoaders`\n\nType: `Array<String|RegExp>`<br>\nDefault: `[]`\n\nWhen you enable `granularLoaderData`, SMP prepends its timing loader to each matching\nloader rule. Use this option to skip rules whose loader chain contains a matching\nloader name or regular expression. String matching checks both the original loader\nrequest and the normalized package name. E.g.\n\n```javascript\nconst smp = new SpeedMeasurePlugin({\n  granularLoaderData: true,\n  excludedLoaders: [\"thread-loader\", /mini-css-extract-plugin/],\n});\n```\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<!-- ALL-CONTRIBUTORS-LIST:START -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://stephencookdev.co.uk/\"><img src=\"https://avatars.githubusercontent.com/u/8496655?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Stephen Cook</b></sub></a><br /><a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=stephencookdev\" title=\"Code\">💻</a> <a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=stephencookdev\" title=\"Documentation\">📖</a> <a href=\"#blog-stephencookdev\" title=\"Blogposts\">📝</a> <a href=\"#design-stephencookdev\" title=\"Design\">🎨</a> <a href=\"#question-stephencookdev\" title=\"Answering Questions\">💬</a> <a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/pulls?q=is%3Apr+reviewed-by%3Astephencookdev\" title=\"Reviewed Pull Requests\">👀</a></td>\n    <td align=\"center\"><a href=\"https://scarletsky.github.io/\"><img src=\"https://avatars.githubusercontent.com/u/2386165?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>scarletsky</b></sub></a><br /><a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=scarletsky\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"https://github.com/wayou\"><img src=\"https://avatars.githubusercontent.com/u/3783096?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>牛さん</b></sub></a><br /><a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=wayou\" title=\"Code\">💻</a> <a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3Awayou\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"https://github.com/ThomasHarper\"><img src=\"https://avatars.githubusercontent.com/u/3199791?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Thomas Bentkowski</b></sub></a><br /><a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=ThomasHarper\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://github.com/alan-agius4\"><img src=\"https://avatars.githubusercontent.com/u/17563226?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Alan Agius</b></sub></a><br /><a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=alan-agius4\" title=\"Code\">💻</a> <a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3Aalan-agius4\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"https://daix.me/\"><img src=\"https://avatars.githubusercontent.com/u/1396511?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Ximing</b></sub></a><br /><a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=NdYAG\" title=\"Code\">💻</a> <a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3ANdYAG\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"https://twitter.com/lihautan\"><img src=\"https://avatars.githubusercontent.com/u/2338632?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Tan Li Hau</b></sub></a><br /><a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=tanhauhau\" title=\"Code\">💻</a> <a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3Atanhauhau\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=tanhauhau\" title=\"Tests\">⚠️</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/ZauberNerd\"><img src=\"https://avatars.githubusercontent.com/u/249542?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Björn Brauer</b></sub></a><br /><a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=ZauberNerd\" title=\"Code\">💻</a> <a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3AZauberNerd\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"https://github.com/The-Only-Matrix\"><img src=\"https://avatars.githubusercontent.com/u/61681157?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Suraj Patel</b></sub></a><br /><a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=The-Only-Matrix\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"https://github.com/hanzooo\"><img src=\"https://avatars.githubusercontent.com/u/16368939?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Jm</b></sub></a><br /><a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=hanzooo\" title=\"Code\">💻</a> <a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/issues?q=author%3Ahanzooo\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/stephencookdev/speed-measure-webpack-plugin/commits?author=hanzooo\" title=\"Tests\">⚠️</a></td>\n  </tr>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","publish_time":1774367265686,"_cnpm_publish_time":1774367265686,"dist-tags":{"beta":"1.0.0-beta-1","latest":"1.6.0"}}