https://github.com/deebloo/ts-dist-options
https://github.com/deebloo/ts-dist-options
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/deebloo/ts-dist-options
- Owner: deebloo
- Created: 2020-06-02T12:43:46.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T14:29:42.000Z (about 6 years ago)
- Last Synced: 2025-02-12T07:53:51.398Z (over 1 year ago)
- Language: TypeScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TS distribution issues
This repo is to demonstrate the potential issues when distributing typescript source code vs compiled js code with d.ts files.
## Install Typescript
```BASH
npm i -g typescript@3.9.3
```
## Build Module 1
Module 1 is built WITHOUT strict compiler options.
```BASH
tsc -p module-1/tsconfig.json
```
## Build Module 2 (Works)
Module 2 is built WITH strict compiler options.
Module 2 depends on Module 1 and uses the js file + d.ts.
This works because the compiler doesn't type check the JS file, just the d.ts file
```BASH
tsc -p module-2/tsconfig.json
```
## Build Module 3 (Fails)
Module 3 is built WITH strict compiler options.
Module 3 depends on Module 1 and uses the source Typescript code
This fails because the compiler needs to compile the source code of Lib 1 which was written with less strict options in mind.
```BASH
tsc -p module-3/tsconfig.json
```