{"id":19257548,"url":"https://github.com/ericvera/typescript-build","last_synced_at":"2026-05-16T04:34:05.437Z","repository":{"id":57383766,"uuid":"361885196","full_name":"ericvera/typescript-build","owner":"ericvera","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-30T19:10:07.000Z","size":1246,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-26T04:43:44.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/ericvera.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}},"created_at":"2021-04-26T20:28:43.000Z","updated_at":"2022-06-02T18:37:44.000Z","dependencies_parsed_at":"2023-02-16T10:46:18.920Z","dependency_job_id":null,"html_url":"https://github.com/ericvera/typescript-build","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/ericvera%2Ftypescript-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvera%2Ftypescript-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvera%2Ftypescript-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvera%2Ftypescript-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericvera","download_url":"https://codeload.github.com/ericvera/typescript-build/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240356097,"owners_count":19788512,"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-09T19:10:37.397Z","updated_at":"2026-05-16T04:34:05.398Z","avatar_url":"https://github.com/ericvera.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript Build v2.0.0+\n\n**Copy files to output directory after `tsc` build**\n\nTypeScript Build (tsb) works in one of two modes. **TSC** mode will run `tsc` with the arguments passed to `tsb` and copy files based on a config if present while **Copy only** mode will only copy files based on the `tsbconfig.json` content.\n\n## Install\n\n```\nnpm install --dev typescript typescript-build\n```\n\nor\n\n```\nyarn add --dev typescript typescript-build\n```\n\n## Usage\n\n1. At the root of the project (next to your `tsconfig.json` if in TSC mode) create a `tsbconfig.json` as described below.\n1. Run the `tsb` command as you would `tsc`.\n\n### Example\n\n```json\n{\n  \"copyFiles\": [\n    {\n      \"files\": [\"src/**/*.css\"],\n      \"outDirectories\": [\"dist\"],\n      \"up\": 1\n    }\n  ]\n}\n```\n\n- `files`: array of [globs](https://github.com/isaacs/node-glob) to match and copy to `outDirectories`\n- `outDirectories`: the output directories relative to the directory of the `tsbconfig.json` file\n- `up`: (optional) number of directories to remove from the matches\n- `skipClean`: (optional/default to false) will skip removing the `outDirectories` on clean\n\nLet's say you have a `tsconfig.json` file with `\"outDirectories\": [\"dist\"]` and the above `tsbconfig.json` in the same directory, and you run `tsb --build` the following will happen:\n\n1. TSB will execute `tsc --build`\n1. If `tsc` succeeds, it will copy all of the css files from the src directory into the dist directory matching the directory, but removing one level form the matches. (e.g. `src/papaya/coolcss.css` will be copied to `dist/papaya/coolcss.css`)\n\nIn the case of `tsb --build --clean` it will:\n\n1. Execute `tsc --build --clean`\n1. If `tsc` succeeds, it will delete the `outDirectories` and all of its content unless `skipClean` is set to `true`.\n\n## FAQ\n\n- Why is nothing happening?\n  - `tsb` will only perform the copy of files if the `--build` options is used and the clean-up if both `--build` and `--clean` options are used.\n- Will it follow references?\n  - Yes. TSB will follow all the references and look for `tsbconfig.json` files next to each of the referenced tsconfig files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericvera%2Ftypescript-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericvera%2Ftypescript-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericvera%2Ftypescript-build/lists"}