{"id":13508591,"url":"https://github.com/Jocs/loader-count-webpack-plugin","last_synced_at":"2025-03-30T11:32:16.502Z","repository":{"id":44166361,"uuid":"145011428","full_name":"Jocs/loader-count-webpack-plugin","owner":"Jocs","description":"Do you know how many files have been processed by a special webpack loader? Let me tell you!","archived":false,"fork":false,"pushed_at":"2024-06-11T09:45:41.000Z","size":753,"stargazers_count":11,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-18T07:11:55.711Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jocs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-08-16T16:09:29.000Z","updated_at":"2025-01-25T18:55:48.000Z","dependencies_parsed_at":"2024-01-13T20:33:55.164Z","dependency_job_id":"f6676814-e1d3-4406-a713-4e33c205bfc9","html_url":"https://github.com/Jocs/loader-count-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jocs%2Floader-count-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jocs%2Floader-count-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jocs%2Floader-count-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jocs%2Floader-count-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jocs","download_url":"https://codeload.github.com/Jocs/loader-count-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314011,"owners_count":20757450,"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-01T02:00:55.292Z","updated_at":"2025-03-30T11:32:15.393Z","avatar_url":"https://github.com/Jocs.png","language":"JavaScript","readme":"## Loader-count-webpack-plugin\n\n这是一个 webpack 插件，帮你统计项目中不同的 webpack loader 所处理的文件数目，特别是 `node_modules` 文件夹中被处理的文件，并在控制台中将结果输出。\n\n### Why write this plugin?\n\n在最近的项目中，我遇到了一个奇怪的 bug，引入 `pdfjs-dist` 模块后，加载 pdf 文件时，始终不发送 Ajax 请求，最后才找到原因，是因为我在项目中引入了 `worker-loader` 来处理以 `.worker.js` 结尾的文件，恰好在 `pdfjs-dist/build/pdf.js` 文件中，引入了 `pdf.worker.js` 文件，而该文件不需要 `worker-loader` 来处理，最终导致了 bug 产生。为了以后不在出现类似的 bug，我写了这个插件。\n\n### Install\n\n```sh\nnpm i loader-count-webpack-plugin\n```\n\n### How to use?\n\n```javascript\nconst path = require('path')\nconst LoaderCountPlugin = require('loader-count-webpack-plugin')\n\nmodule.exports = {\n  mode: 'production',\n  entry: './index.js',\n  output: {\n    filename: 'bundle.js',\n    path: path.join(__dirname, 'dist')\n  },\n  module: {\n    rules: [{\n      test: /\\.worker\\.js$/,\n      use: {\n        loader: 'worker-loader'\n      }\n    }]\n  },\n  plugins: [\n    new LoaderCountPlugin()\n  ]\n}\n```\n\n### Result\n\n![](./result.jpg)\n\n### License\n\n**MIT**\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJocs%2Floader-count-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJocs%2Floader-count-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJocs%2Floader-count-webpack-plugin/lists"}