0

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.

1 Answers1

0

run tsc scriptname.ts This will compile the new JavaScript file to be scriptname.js.

Update

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.

To compile

Run tsc -w this will compile all .ts files from the rootDir and save them in the outDir directory.

Erisan Olasheni
  • 2,395
  • 17
  • 20