{"id":15676909,"url":"https://github.com/smacker/esbuild-plugin-ts-references","last_synced_at":"2025-05-06T22:05:30.601Z","repository":{"id":40357880,"uuid":"459248433","full_name":"smacker/esbuild-plugin-ts-references","owner":"smacker","description":"esbuild plugin for typescript references","archived":false,"fork":false,"pushed_at":"2022-12-10T06:50:32.000Z","size":33,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T22:19:15.051Z","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/smacker.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":"2022-02-14T16:57:08.000Z","updated_at":"2025-02-03T04:58:22.000Z","dependencies_parsed_at":"2023-01-25T22:55:11.927Z","dependency_job_id":null,"html_url":"https://github.com/smacker/esbuild-plugin-ts-references","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/smacker%2Fesbuild-plugin-ts-references","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smacker%2Fesbuild-plugin-ts-references/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smacker%2Fesbuild-plugin-ts-references/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smacker%2Fesbuild-plugin-ts-references/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smacker","download_url":"https://codeload.github.com/smacker/esbuild-plugin-ts-references/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252776573,"owners_count":21802467,"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-10-03T16:07:08.457Z","updated_at":"2025-05-06T22:05:30.551Z","avatar_url":"https://github.com/smacker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esbuild-plugin-ts-references\n\n[esbuild](https://github.com/evanw/esbuild) plugin for [Typescript references](https://www.typescriptlang.org/docs/handbook/project-references.html).\n\n## Rationale\n\nA common approach for monorepos is yarn/npm/pnpm workspaces + typescript references.\n\nWhile it works in VSCode and using `tsc --build`, esbuild doesn't resolve such references automatically. The [feature request](https://github.com/evanw/esbuild/issues/1250) to add support for it was closed as it is not in the scope of the bundler and creation of a plugin was suggested.\n\nThis is *the* plugin.\n\n## Installation\n\n```sh\nnpm install --save-dev esbuild-plugin-ts-references\n```\n\n## Usage\n\nDefine plugin in the `plugins` section of esbuild config like this:\n\n```js\nconst esbuild = require('esbuild');\nconst tsReferences = require('esbuild-plugin-ts-references');\n\nesbuild.build({\n  // ...\n  plugins: [tsReferences]\n});\n```\n\n## Implementation details\n\nCurrently the algorithm to resolve the references is very simple (but it works for me):\n\n- Find the closest `tsconfig.json` to the build target\n- Resolve `package.json` and `tsconfig.json` of references\n- Map package name from `package.json` to `rootDir` from `tsconfig.json`\n- Profit!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmacker%2Fesbuild-plugin-ts-references","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmacker%2Fesbuild-plugin-ts-references","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmacker%2Fesbuild-plugin-ts-references/lists"}