{"id":18113377,"url":"https://github.com/gxy5202/parcel-namer-hashless","last_synced_at":"2025-04-14T07:11:10.718Z","repository":{"id":49951261,"uuid":"448018293","full_name":"gxy5202/parcel-namer-hashless","owner":"gxy5202","description":"⭐A parcel plugin which make your bundle file‘s name without hash","archived":false,"fork":false,"pushed_at":"2024-11-12T08:41:55.000Z","size":14381,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T15:26:51.341Z","etag":null,"topics":["hash","javascript","parcel","parcel-bundler","parcel-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/parcel-namer-hashless","language":"TypeScript","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/gxy5202.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-14T15:38:18.000Z","updated_at":"2024-11-12T08:21:20.000Z","dependencies_parsed_at":"2024-06-21T04:18:40.620Z","dependency_job_id":"898cab62-9711-4cf4-b707-5db58137c8a8","html_url":"https://github.com/gxy5202/parcel-namer-hashless","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.4375,"last_synced_commit":"0103f0af232f0625f8a0e7c4ea6ca297aab1f783"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gxy5202%2Fparcel-namer-hashless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gxy5202%2Fparcel-namer-hashless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gxy5202%2Fparcel-namer-hashless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gxy5202%2Fparcel-namer-hashless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gxy5202","download_url":"https://codeload.github.com/gxy5202/parcel-namer-hashless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724639,"owners_count":21151561,"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":["hash","javascript","parcel","parcel-bundler","parcel-plugin"],"created_at":"2024-11-01T02:08:07.737Z","updated_at":"2025-04-14T07:11:10.697Z","avatar_url":"https://github.com/gxy5202.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\nparcel-namer-hashless\n\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![](https://flat.badgen.net/npm/v/parcel-namer-hashless) ![npm](https://flat.badgen.net/npm/dm/parcel-namer-hashless) ![](https://flat.badgen.net/npm/license/parcel-namer-hashless) \n\n\u003c/div\u003e\n\n## Feature\n\nThis plugin will help you remove the hash from a bundle file name(only support parcel v2.x).\n\n\u003e Note: since v1.0.4, need your parcel \u003e= v2.8.3\n\n## Why\n\nIf you are using parcel to package files, you may encounter the following situations.\nWhen you package index.html that references other files, parcel treats those files as shared bundles and adds a hash to the file name by default, even if you set `--no-content-hash` in package.json.\n\nSo when you need a filename without any hash value, using this plugin can help you. For example, when you are developing a web browser extension, you need all file names to be stable and hashless\n\n## Installation\n\nnpm:\n`npm i parcel-namer-hashless -D`\n\nyarn:\n`yarn add parcel-namer-hashless -D`\n\npnpm:\n`pnpm add parcel-namer-hashless -D`\n\n## Useage\n\nEdit .parcelrc file to add new namer:\n\n```\n/* .parcelrc */\n{\n  \"extends\": \"@parcel/config-default\",\n  \"namers\": [ \"parcel-namer-hashless\" ]\n}\n```\n\n## Configuration\n\n\n`parcel-namer-hashless` exists as an optional field in package.json.\n\nIf you want to remove the hash values of all filenames, ignore this field.\n\nIf you want precise control over certain files, you can configure the `include` or `exclude` field\n\n- `include: string[]`: The file that you want to remove the hash from\n- `exclude: string[]`: The file that you don't want to remove the hash from\n\nuse regular expressions\n```\n// package.json\n\n\"parcel-namer-hashless\": {\n    \"include\": [\".js$\", \".css$\", '.card.png$']\n}\n// or\n\"parcel-namer-hashless\": {\n    \"exclude\": [\".css$\"]\n}\n// or\n\"parcel-namer-hashless\": {\n  \"include\": [\".js$\", \".css$\", '.card.png$']\n  \"exclude\": [\".background.png$\"]\n}\n \n```\n\n`mode` allows you to control which environments take effect\n- `mode: 'all' | 'development' | 'production'`: `production` as default.\n```\n// package.json\n\n\"parcel-namer-hashless\": {\n    \"include\": [\".js$\", \".css$\", '.card.png$'],\n    \"mode\": 'all'\n}\n```\n\n`log` allows you to disable logging info.\n- `log: true | false`: `true` as default\n  \n```\n// package.json\n\n\"parcel-namer-hashless\": {\n    \"log\": false\n}\n\n```\n\n## Result\n\nIf you run the plugin successfully, the terminal will output：\n\n```\nparcel-namer-hashless: index.794a6267.js -\u003e index.js\n```\n\n## Issue\n- Error: Bundles must have unique names: There is a \u003cscript\u003e tag in your index.html file. In this case, parcel will generate a index.js file. So if you have another \u003cscript\u003e tag to import 'main.ts', parcel will generate two index.js file. But we should notice that the first index.js file will not output as a file in your dist. So i delete your first \u003cscript\u003e tag, then everything works fine.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgxy5202%2Fparcel-namer-hashless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgxy5202%2Fparcel-namer-hashless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgxy5202%2Fparcel-namer-hashless/lists"}