https://github.com/matii96/nx-tsc
Typescript executor for Nx workspace.
https://github.com/matii96/nx-tsc
nodejs nx-workspace tsc typescript
Last synced: 23 days ago
JSON representation
Typescript executor for Nx workspace.
- Host: GitHub
- URL: https://github.com/matii96/nx-tsc
- Owner: Matii96
- License: mit
- Created: 2022-03-13T08:35:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-16T08:44:04.000Z (over 3 years ago)
- Last Synced: 2025-11-23T10:08:40.522Z (7 months ago)
- Topics: nodejs, nx-workspace, tsc, typescript
- Language: TypeScript
- Homepage:
- Size: 241 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nx-tsc
[](/LICENSE) 
[Typescript](https://www.typescriptlang.org) executor for [Nx workspace](https://nx.dev).
## Why?
Nx only allows to use webpack as ts builder. While it has benefits like slightly reduced bundle size, it makes using build-reliant libraries like [MikroORM](https://mikro-orm.io) a pain to use as it prevents distribution directory exploration.
## How?
Nx-tsc eliminates this problem by introducing a full-fledged tsc build keeping hot-reload (serve) option.
## Installation
```bash
$ npm i --save-dev @matii96/nx-tsc
```
## Example
App's project.json:
```json
{
"root": "apps/my-app",
"sourceRoot": "apps/my-app/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@matii96/nx-tsc:build",
"options": {
"main": "apps/my-app/src/main.js",
"tsConfig": "apps/my-app/tsconfig.app.json",
"assets": ["apps/my-app/src/assets"]
},
"configurations": {
"production": {
"optimization": true,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
{
"replace": "apps/my-app/src/environments/environment.ts",
"with": "apps/my-app/src/environments/environment.prod.ts"
}
]
}
}
},
"..."
},
"tags": []
}
```
App's tsconfig.app.json:
```json
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc/my-app",
"..."
},
"..."
}
```
Nothing changes in serve and build commands:
```bash
$ nx serve my-app
$ nx build my-app
```
## Options
| Property | What it does | Required |
| -------------- | ------------------------------------------------------ | -------- |
| `main` | The name of the main entry-point file | ✓ |
| `tsConfig` | The name of the Typescript configuration file | ✓ |
| `assets` | List of static application assets | ✓ |
| `watch` | Run build when files change | |
| `debounceTime` | Debounce timeout after last file change for watch mode | |
## License
Nx-tsc is [MIT licensed](LICENSE).