{"id":15650150,"url":"https://github.com/egoist/babel-plugin-webpack-chunkname","last_synced_at":"2025-04-15T01:16:00.868Z","repository":{"id":45275463,"uuid":"115633450","full_name":"egoist/babel-plugin-webpack-chunkname","owner":"egoist","description":"Automatically set the chunkname for dynamic imports","archived":false,"fork":false,"pushed_at":"2022-12-07T09:17:01.000Z","size":422,"stargazers_count":36,"open_issues_count":17,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T01:15:42.022Z","etag":null,"topics":["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/egoist.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":"2017-12-28T14:59:18.000Z","updated_at":"2023-08-09T13:57:02.000Z","dependencies_parsed_at":"2023-01-24T16:30:59.257Z","dependency_job_id":null,"html_url":"https://github.com/egoist/babel-plugin-webpack-chunkname","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fbabel-plugin-webpack-chunkname","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fbabel-plugin-webpack-chunkname/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fbabel-plugin-webpack-chunkname/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fbabel-plugin-webpack-chunkname/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egoist","download_url":"https://codeload.github.com/egoist/babel-plugin-webpack-chunkname/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986315,"owners_count":21194025,"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":["webpack"],"created_at":"2024-10-03T12:33:36.701Z","updated_at":"2025-04-15T01:16:00.849Z","avatar_url":"https://github.com/egoist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# babel-plugin-webpack-chunkname\n\n[![NPM version](https://img.shields.io/npm/v/babel-plugin-webpack-chunkname.svg?style=flat)](https://npmjs.com/package/babel-plugin-webpack-chunkname) [![NPM downloads](https://img.shields.io/npm/dm/babel-plugin-webpack-chunkname.svg?style=flat)](https://npmjs.com/package/babel-plugin-webpack-chunkname) [![CircleCI](https://circleci.com/gh/egoist/babel-plugin-webpack-chunkname/tree/master.svg?style=shield)](https://circleci.com/gh/egoist/babel-plugin-webpack-chunkname/tree/master)  [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000\u0026style=flat)](https://github.com/egoist/donate) [![chat](https://img.shields.io/badge/chat-on%20discord-7289DA.svg?style=flat)](https://chat.egoist.moe)\n\n## Install\n\n```bash\nyarn add babel-plugin-webpack-chunkname\n```\n\n## Usage\n\nWith `.babelrc`:\n\n```json\n{\n  \"plugins\": [\n    \"webpack-chunkname\"\n  ]\n}\n```\n\nAnd it does this:\n\n```js\nimport('./pages/Home')\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nimport( /* webpackChunkName: 'pages/Home' */'./pages/Home')\n```\n\nAnd if you're using dynamic imports:\n\n```js\nimport(`./pages/${name}`)\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nimport( /* webpackChunkName: 'pages/[request]' */`./pages/${name}`)\n```\n\nOr using placeholder:\n\n```js\nimport(/* webpackChunkName: \"__CHUNK_NAME__\" */ `./foo`)\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nimport(/* webpackChunkName: \"foo\" */ `./foo`)\n```\n\n## Options\n\n#### getChunkName\n\n- __Type__: `(imported: string) =\u003e string`\n- __Default__: `imported =\u003e imported.replace(/^[./]+|(\\.js$)/g, '')`\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n\n## Author\n\n**babel-plugin-webpack-chunkname** © [EGOIST](https://github.com/egoist), Released under the [MIT](./LICENSE) License.\u003cbr\u003e\nAuthored and maintained by EGOIST with help from contributors ([list](https://github.com/egoist/babel-plugin-webpack-chunkname/contributors)).\n\n\u003e [egoist.moe](https://egoist.moe) · GitHub [@EGOIST](https://github.com/egoist) · Twitter [@_egoistlily](https://twitter.com/_egoistlily)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fbabel-plugin-webpack-chunkname","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegoist%2Fbabel-plugin-webpack-chunkname","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fbabel-plugin-webpack-chunkname/lists"}