{"id":21839222,"url":"https://github.com/alibasiccoder/chunks-tracker","last_synced_at":"2026-05-19T02:39:07.485Z","repository":{"id":57198668,"uuid":"355236099","full_name":"AliBasicCoder/chunks-tracker","owner":"AliBasicCoder","description":"a small library to track chunks the [rollup](https://rollupjs.org/guide/en/) generates","archived":false,"fork":false,"pushed_at":"2021-04-06T15:20:32.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T01:32:00.080Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AliBasicCoder.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":"2021-04-06T15:18:33.000Z","updated_at":"2021-04-06T15:20:34.000Z","dependencies_parsed_at":"2022-09-16T14:10:28.007Z","dependency_job_id":null,"html_url":"https://github.com/AliBasicCoder/chunks-tracker","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/AliBasicCoder%2Fchunks-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliBasicCoder%2Fchunks-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliBasicCoder%2Fchunks-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliBasicCoder%2Fchunks-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AliBasicCoder","download_url":"https://codeload.github.com/AliBasicCoder/chunks-tracker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244819801,"owners_count":20515646,"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-11-27T21:16:42.230Z","updated_at":"2026-05-19T02:39:07.445Z","avatar_url":"https://github.com/AliBasicCoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chunks-tracker\n\na small library to track chunks the [rollup](https://rollupjs.org/guide/en/) generates\n\n## Why?\n\nyou could this prevent rollup from creating new files for chunks and filling you build directory\n\n## Usage\n\n```js\nimport chunksTracker from \"chunks-tracker\";\n\nexport default {\n  input: \"index.js\",\n  output: {\n    // ...\n    chunkFileNames: chunksTracker({ ...yourOptions }),\n    // if you to prevent rollup from creating new files for chunks and filling you build directory\n    chunkFileNames: chunksTracker({\n      dir: \"\u003cyour-build-folder\u003e\",\n      storeIn: \"chunks.json\",\n      preventRepeat: true,\n    }),\n  },\n};\n```\n\n## Options\n\nall options are optional\n\n### dir\n\ndefault: undefined\n\nthe path to your build directory relative to the current working directory (cwd)\n\n### format\n\ndefault: undefined\n\nthe format for your build files\n\n### schema\n\ndefault: \"[name]-[hash].js\"\n\nthe schema for your chunks names for example: if your schema is the default chunksTracker will replace \"[name]\" with the file name and replace \"[hash]\" with random letters and numbers\n\n[name]: the file name\n[hash]: some random letters and numbers\n[format]: the format for the file (eg. cjs) you need to pass [format](#format)\n\n### storeIn\n\ndefault: false\n\na path to a json file relative to the build folder\n\nthe json file will be an object where\n\n- the keys are the path of the source files of the chunks relative to cwd\n- the values are the path of the chunks relative to the build folder\n\nfor example:\n\nif dynamically you import a file called (for example) \"my-file.js\" in cwd\nthe json file will look like this:\n\n```json\n{ \"my-file.js\": \"my-file-2a8e18e.js\" }\n```\n\n### preventRepeat\n\ndefault: false\n\nneed [storeIn](#storein) to be specified\n\na boolean if true will prevent rollup from creating new files for the same source files\n\nfor example:\n\nif you're in watch mode\n\nand you dynamically import a file called \"my-file.js\"\n\nin the first run `chunks-tracker` will store it's source file path and it's generated chunks path (as shown in [storeIn](#storeIn)) and return generated chunks path to rollup\n\nif you then update it\n\n`chunks-tracker` will read the json file and return generated chunks path to rollup so rollup will update that file\ninstead of creating a new one\n\n### hashLen\n\ndefault: 20\n\nthe length of the hash(s) in generated chunks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falibasiccoder%2Fchunks-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falibasiccoder%2Fchunks-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falibasiccoder%2Fchunks-tracker/lists"}