{"id":32481813,"url":"https://github.com/aprosail/tsconfig-aliases","last_synced_at":"2025-10-27T02:59:56.353Z","repository":{"id":318711777,"uuid":"1073582575","full_name":"aprosail/tsconfig-aliases","owner":"aprosail","description":"Parse aliases from tsconfig.json (or other tsconfig files) for bundler configurations.","archived":false,"fork":false,"pushed_at":"2025-10-10T14:58:16.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-10T16:02:34.917Z","etag":null,"topics":["node","rolldown","ts","tsconfig","tsconfig-json","tsconfig-paths","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tsconfig-aliases","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aprosail.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-10T10:15:51.000Z","updated_at":"2025-10-10T14:58:19.000Z","dependencies_parsed_at":"2025-10-10T16:02:45.469Z","dependency_job_id":"c278b257-ce64-43b7-bba5-7823164e6b67","html_url":"https://github.com/aprosail/tsconfig-aliases","commit_stats":null,"previous_names":["aprosail/tsconfig-aliases"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aprosail/tsconfig-aliases","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aprosail%2Ftsconfig-aliases","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aprosail%2Ftsconfig-aliases/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aprosail%2Ftsconfig-aliases/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aprosail%2Ftsconfig-aliases/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aprosail","download_url":"https://codeload.github.com/aprosail/tsconfig-aliases/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aprosail%2Ftsconfig-aliases/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281207059,"owners_count":26461324,"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","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["node","rolldown","ts","tsconfig","tsconfig-json","tsconfig-paths","typescript"],"created_at":"2025-10-27T02:59:55.258Z","updated_at":"2025-10-27T02:59:56.344Z","avatar_url":"https://github.com/aprosail.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TSConfig Aliases\n\nNow moved inside the\n[rolldown-enhance](https://github.com/aporsail/rolldown-enhance) package.\n\n[en(English)](./README.md) |\n[zh(中文)](./README_zh.md)\n\nParse aliases from `tsconfig.json` (or other tsconfig files)\nfor bundler configurations.\n\nThis package is designed to work with bundlers like Rolldown.\nIt is exactly a tool for parsing aliases in `Record\u003cstring, string\u003e` format\nfrom a `tsconfig.json` file or parsed object,\nyou can use it in any bundler that support configuration format like this.\n\n## Usages\n\n### 1. Parse Aliases from `tsconfig.json`\n\nYou may configure `tsconfig.json` like this:\n\n```json\n{\n  // Definitely, this package supports parse from json with comments.\n  \"compilerOptions\": {\n    // ... (other compiler options)\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@/*\": [\"./src/*\"]\n    }\n  },\n  \"include\": [\n    // ... (custom include paths)\n  ]\n}\n```\n\nAnd then you can use it in your bundler like this:\n\n```ts\n// Rolldown for example.\nimport { builtinModules } from \"node:module\"\nimport { defineConfig } from \"rolldown\"\nimport { dts } from \"rolldown-plugin-dts\"\nimport tsconfigAliases from \"tsconfig-aliases\"\n\nexport default defineConfig({\n  // Configure like this and it will detect tsconfig.json in cwd by default.\n  resolve: { alias: tsconfigAliases() },\n\n  // Other options for example.\n  plugins: [dts({ sourcemap: true })],\n  external: [/^node:/g, ...builtinModules],\n  input: \"xxx.ts\",\n  output: { dir: \"xxx\", format: \"esm\", minify: true, sourcemap: true },\n})\n```\n\n### 2. Custom TSConfig Path\n\nYou can also specify a custom path to `tsconfig.json` like this:\n\n```ts\n// Rolldown for example.\nimport { builtinModules } from \"node:module\"\nimport { defineConfig } from \"rolldown\"\nimport { dts } from \"rolldown-plugin-dts\"\nimport tsconfigAliases from \"tsconfig-aliases\"\n\nexport default defineConfig({\n  // Specify custom tsconfig.json path.\n  resolve: { alias: tsconfigAliases(\"./tsconfig.build.json\") },\n\n  // Other options for example.\n  plugins: [dts({ sourcemap: true })],\n  external: [/^node:/g, ...builtinModules],\n  input: \"xxx.ts\",\n  output: { dir: \"xxx\", format: \"esm\", minify: true, sourcemap: true },\n})\n```\n\n### 3. Custom TSConfig Object\n\n```ts\n// Rolldown for example.\nimport { readFileSync } from \"node:fs\"\nimport { builtinModules } from \"node:module\"\nimport { defineConfig } from \"rolldown\"\nimport { dts } from \"rolldown-plugin-dts\"\nimport tsconfigAliases from \"tsconfig-aliases\"\n\nconst tsconfig = readFileSync(\"./tsconfig.xxx.json\", \"utf-8\")\n\nexport default defineConfig({\n  // Specify custom tsconfig.json object.\n  resolve: { alias: tsconfigAliases(tsconfig) },\n\n  // Other options for example.\n  plugins: [dts({ sourcemap: true })],\n  external: [/^node:/g, ...builtinModules],\n  input: \"xxx.ts\",\n  output: { dir: \"xxx\", format: \"esm\", minify: true, sourcemap: true },\n})\n```\n\n## Compatibilities\n\nWhen using commonjs mode, you need to use `default`\nto access the default exported function like this:\n\n```js\nconst tsconfigAliases = require(\"tsconfig-aliases\").default\n```\n\nor:\n\n```js\nconst { default: tsconfigAliases } = require(\"tsconfig-aliases\")\n```\n\n## Open Source License\n\nThis package is released under the [Apache 2.0 License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faprosail%2Ftsconfig-aliases","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faprosail%2Ftsconfig-aliases","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faprosail%2Ftsconfig-aliases/lists"}