{"id":20426009,"url":"https://github.com/seleb/chunk-progress-webpack-plugin","last_synced_at":"2025-04-12T19:02:34.460Z","repository":{"id":57198724,"uuid":"133181217","full_name":"seleb/chunk-progress-webpack-plugin","owner":"seleb","description":"Provides runtime progress events by replacing default webpack chunk loading with XHR","archived":false,"fork":false,"pushed_at":"2021-08-07T05:14:43.000Z","size":9,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-16T06:01:41.182Z","etag":null,"topics":["chunk","javascript","webpack","webpack-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/chunk-progress-webpack-plugin","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/seleb.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-05-12T20:29:13.000Z","updated_at":"2024-05-04T20:34:15.000Z","dependencies_parsed_at":"2022-09-16T14:11:50.170Z","dependency_job_id":null,"html_url":"https://github.com/seleb/chunk-progress-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleb%2Fchunk-progress-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleb%2Fchunk-progress-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleb%2Fchunk-progress-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleb%2Fchunk-progress-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seleb","download_url":"https://codeload.github.com/seleb/chunk-progress-webpack-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618280,"owners_count":21134200,"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":["chunk","javascript","webpack","webpack-plugin"],"created_at":"2024-11-15T07:14:57.697Z","updated_at":"2025-04-12T19:02:34.431Z","avatar_url":"https://github.com/seleb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chunk-progress-webpack-plugin\n\nReplaces the default async chunk loader with one which uses XHR and triggers progress event on `document`.\n\n## Install\n\n```sh\nnpm i --save-dev chunk-progress-webpack-plugin\n```\n\nor\n\n```sh\nyarn add --dev chunk-progress-webpack-plugin\n```\n\n## Use\n\nIn config:\n\n```js\nconst ChunkProgressWebpackPlugin = require('chunk-progress-webpack-plugin');\n...\n{\n\tplugins: [\n\t\tnew ChunkProgressWebpackPlugin()\n\t]\n}\n```\n\nIn application:\n\n```js\ndocument.addEventListener('chunk-progress-webpack-plugin', function(event) {\n\tevent.detail.loaded; // total bytes loaded\n\tevent.detail.total; // total bytes requested\n\tevent.detail.loaded / event.detail.total * 100; // total progress percentage\n\tconst resource = event.detail.resource; // info about resource that triggered the event\n\tresource.loaded;\n\tresource.total;\n\tresource.url;\n});\n```\n\nThe root `loaded`/`total` values are reset to 0 when all concurrent loads complete. This is particularly useful for cases where user interaction is blocked while resources are loading (e.g. startup of a SPA or web game). In cases where multiple unrelated sections of code are importing resources asynchronously, the `resource` values are likely to be more useful.\n\nA complete/100% progress event is not provided under the assumption that this can be handled on the complete of the original resource import; e.g. `import('resource').then(()=\u003e{/* fully loaded */})`\n\n## XHR Caveats\n\nBecause this plugin makes webpack use XHR instead of JSONP to load resources, there are some things to keep in mind:\n\n- You may run into CORS issues (e.g. you won't be able to run the bundled result over `file://` protocol in Chrome)\n- Extra `HEAD` requests are made to determine file-sizes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseleb%2Fchunk-progress-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseleb%2Fchunk-progress-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseleb%2Fchunk-progress-webpack-plugin/lists"}