In the process of using ts, I wanted to see the source code for lib. I cannot see the corresponding implementation. What should I do?
Update
I was hoping to see third-party lib
source.
In the process of using ts, I wanted to see the source code for lib. I cannot see the corresponding implementation. What should I do?
I was hoping to see third-party lib
source.
run tsc scriptname.ts
This will compile the new JavaScript file to be scriptname.js
.
To compile all .ts
files in a directory, just create a tsconfig.json
file in that directory, with these minimal options:
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"module": "commonjs",
"target": "ES6",
"outDir": "ts-built",
"rootDir": "src"
}
}
Note: The outDir
is the directory to save the compiled .js
files.
Run tsc -w
this will compile all .ts
files from the rootDir
and save them in the outDir
directory.