|
| 1 | +# esbuild plugin typescript |
| 2 | + |
| 3 | +  |
| 4 | + |
| 5 | +The plugin enhances the build process by seamlessly integrating TypeScript, offering powerful features like type checking, automatic generation of .d.ts files, and ensuring robust type safety |
| 6 | +throughout. |
| 7 | + |
| 8 | +* Supports newest esbuild and typescript version |
| 9 | +* Uses esbuild config to determine the out folder |
| 10 | +* Can do everything that TypeScript offers |
| 11 | +* Type declarations (d.ts) included |
| 12 | + |
| 13 | +## How It Works |
| 14 | + |
| 15 | +1. esbuild calls this package in the onStart lifecycle. |
| 16 | +2. Gets the configuration from esbuild or user-defined configuration. |
| 17 | +3. Evaluate the out folder, that should be deleted, based on the given input. |
| 18 | +4. Runs the official TypeScript-Compiler by its API and\ |
| 19 | +generates output based on the given tsconfig. |
| 20 | + |
| 21 | +## Options |
| 22 | + |
| 23 | +### Overriding the out-folder |
| 24 | + |
| 25 | +This package will search for a tsconfig by TypeScript itself. |
| 26 | +It can be helpful sometimes to override the path to the tsconfig: |
| 27 | +```typescript |
| 28 | +typescriptPlugin( |
| 29 | + overrideConfigPath?: string | undefined |
| 30 | +); |
| 31 | +``` |
| 32 | + |
| 33 | +After using this override, this package will start to resolve your tsconfig. If your override is not valid, because the tsconfig does not exists, this package will discover the nearest tsconfing. |
| 34 | + |
| 35 | +## Usage |
| 36 | + |
| 37 | +### Installation |
| 38 | + |
| 39 | +The plugin can be installed by any package manager. |
| 40 | + |
| 41 | +<details><summary><b>Show instructions</b></summary> |
| 42 | + |
| 43 | +> npm \ |
| 44 | +> ``npm install esbuild-plugin-typescript`` |
| 45 | +
|
| 46 | +> yarn \ |
| 47 | +> ``yarn install esbuild-plugin-typescript`` |
| 48 | +
|
| 49 | +> pnpm \ |
| 50 | +> ``pnpm install esbuild-plugin-typescript`` |
| 51 | +
|
| 52 | +</details> |
| 53 | + |
| 54 | +### Integration |
| 55 | + |
| 56 | +The easy way to integrate this plugin in esbuild. |
| 57 | + |
| 58 | +<details><summary><b>Show instructions</b></summary> |
| 59 | + |
| 60 | +````typescript |
| 61 | +await esbuild.build({ |
| 62 | + plugins: [ |
| 63 | + typescriptPlugin(...) |
| 64 | + ] |
| 65 | +}) |
| 66 | +```` |
| 67 | + |
| 68 | +[See here for more about the esbuild plugin integration.](https://esbuild.github.io/plugins/#using-plugins) |
| 69 | + |
| 70 | +</details> |
| 71 | + |
| 72 | +## License |
| 73 | + |
| 74 | +The MIT License (MIT) - Please have a look at the LICENSE file for more details. |
| 75 | + |
| 76 | +## Contributing |
| 77 | + |
| 78 | +Feel free to contribute to this project.\ |
| 79 | +You can fork this project and create a new pull request for contributing. |
| 80 | + |
| 81 | +[Get to the repository at GitHub.](https://github.com/simonkovtyk/esbuild-plugin-typescript) |
| 82 | + |
| 83 | +<hr> |
| 84 | + |
| 85 | +GitHub [@simonkovtyk](https://github.com/simonkovtyk) |
0 commit comments