{"id":13516955,"url":"https://github.com/a7ul/esbuild-node-tsc","last_synced_at":"2025-05-15T13:07:11.687Z","repository":{"id":37402213,"uuid":"298861293","full_name":"a7ul/esbuild-node-tsc","owner":"a7ul","description":"Build your Typescript Node.js projects using blazing fast esbuild","archived":false,"fork":false,"pushed_at":"2023-01-06T20:50:38.000Z","size":194,"stargazers_count":710,"open_issues_count":7,"forks_count":45,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-22T03:28:27.397Z","etag":null,"topics":["development","esbuild","esbuild-node","nodejs","openlibrary","ts-node","tsnode"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/esbuild-node-tsc","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/a7ul.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":"2020-09-26T17:04:13.000Z","updated_at":"2025-04-10T17:34:35.000Z","dependencies_parsed_at":"2023-02-06T09:02:14.938Z","dependency_job_id":null,"html_url":"https://github.com/a7ul/esbuild-node-tsc","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7ul%2Fesbuild-node-tsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7ul%2Fesbuild-node-tsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7ul%2Fesbuild-node-tsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7ul%2Fesbuild-node-tsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a7ul","download_url":"https://codeload.github.com/a7ul/esbuild-node-tsc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"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":["development","esbuild","esbuild-node","nodejs","openlibrary","ts-node","tsnode"],"created_at":"2024-08-01T05:01:27.706Z","updated_at":"2025-05-15T13:07:06.673Z","avatar_url":"https://github.com/a7ul.png","language":"JavaScript","readme":"# ⚡️ esbuild-node-tsc\n\nBuild your Typescript Node.js projects using blazing fast **[esbuild](https://github.com/evanw/esbuild)**.\n\nSince esbuild can build large typescript node projects in subsecond speeds, this is quite useful for development builds too if you want to stick with `tsc` for production builds.\n\n**_Please note this library doesnt do typechecking. For typechecking please continue to use tsc._**\n\n## Alternatives\n\nRecently, Many alternatives have been released that allow using esbuild with nodejs projects.\n\nYou could try these too. They solve the same problem but using require hooks instead.\n\n- **[esbuild-node-loader](https://github.com/antfu/esbuild-node-loader) by [@antfu](https://github.com/antfu)**\n- **[esbuild-register](https://github.com/egoist/esbuild-register) by [@egoist](https://github.com/egoist)**\n- **[ts-eager](https://github.com/mhart/ts-eager) by [@mhart](https://github.com/mhart)**\n\n## How does it work?\n\nesbuild-node-tsc reads the tsconfig.json and builds the typescript project using esbuild. esbuild is the fastest typescript builder around.\nThe purpose of this library is to read tsconfig and translate the options to esbuild.\n\nYou can also perform custom postbuild and prebuild operations like copying non ts files such as json, graphql files, images,etc to the dist folder or cleaning up build folder.\n\n## Installation\n\n```\nnpm install --save-dev esbuild esbuild-node-tsc\n```\n\n## Usage\n\n```\nnpx esbuild-node-tsc\n```\n\nor use the short form.\n\n```\nnpx etsc\n```\n\nAdditionally, you can add it to your build scripts\n\n```json\n{\n  \"name\": \"myproject\",\n  \"version\": \"0.1.0\",\n  \"scripts\": {\n    \"dev\": \"etsc\"\n  }\n}\n```\n\nThen just run\n\n```\nnpm run dev\n```\n\n## Live reloading (nodemon ❤️ esbuild-node-tsc)\n\nSince esbuild can build large typescript projects in subsecond speeds you can use this library instead of ts-node-dev or ts-node which usually slow down when project scales.\n\nTo achieve live reloading:\n\n```\nnpm install --save-dev nodemon esbuild-node-tsc esbuild\n```\n\nThen add the following script to package.json\n\n```json\n{\n  \"name\": \"myproject\",\n  \"version\": \"0.1.0\",\n  \"scripts\": {\n    \"dev\": \"nodemon\"\n  }\n}\n```\n\nAnd add a `nodemon.json`\n\n```json\n{\n  \"watch\": [\"src\"],\n  \"ignore\": [\"src/**/*.test.ts\"],\n  \"ext\": \"ts,mjs,js,json,graphql\",\n  \"exec\": \"etsc \u0026\u0026 node ./dist/index.js\",\n  \"legacyWatch\": true\n}\n```\n\nFinally run\n\n```\nnpm run dev\n```\n\n## Comparison with tsc\n\n\u003cimg src=\"https://user-images.githubusercontent.com/4029423/94347242-c6497600-0032-11eb-8a66-4311adf04554.gif\" width=\"638\" height=\"750\"\u003e\n\n## v2.0 Migration and Breaking changes 🌱\n\nIn v2.0, esbuild-node-tsc no longer has cpy and rimraf preinstalled and doesnt perform any non source file copying automatically.\nInstead it exposes prebuild and postbuild hooks which can be used to perform custom operations. See the example below for more details.\n\n## Optional configuration\n\nBy default esbuild-node-tsc should work out of the box for your project since it reads the necessary configuration from your tsconfig.json\n\nBut if things are not working as expected you can configure esbuild-node-tsc by adding `etsc.config.js` along side tsconfig.json.\n\nExample `etsc.config.js`\n\n```js\nmodule.exports = {\n  // Supports all esbuild.build options\n  esbuild: {\n    minify: false,\n    target: \"es2015\",\n  },\n  // Prebuild hook\n  prebuild: async () =\u003e {\n    console.log(\"prebuild\");\n    const rimraf = (await import(\"rimraf\")).default;\n    rimraf.sync(\"./dist\"); // clean up dist folder\n  },\n  // Postbuild hook\n  postbuild: async () =\u003e {\n    console.log(\"postbuild\");\n    const cpy = (await import(\"cpy\")).default;\n    await cpy(\n      [\n        \"src/**/*.graphql\", // Copy all .graphql files\n        \"!src/**/*.{tsx,ts,js,jsx}\", // Ignore already built files\n      ],\n      \"dist\"\n    );\n  },\n};\n```\n\nAll of the above fields are optional.\n\nIf you want to use different config files for different types of builds you can do so using the param `--config`. Example:\n\n```\n  \"scripts\": {\n    \"build\": \"etsc --config=etsc.config.build.js\"\n  }\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":["JavaScript","打包工具","JavaScript Ecosystem"],"sub_categories":["非 JavaScript 编译工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7ul%2Fesbuild-node-tsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa7ul%2Fesbuild-node-tsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7ul%2Fesbuild-node-tsc/lists"}