Add a TypeScript configuration file
You’ll want to bring your TypeScript files together - both the code you’ll be writing as well as any necessary declaration files.
To do this, you’ll need to create a tsconfig.json
which contains a list of your input files as well as all your compilation settings. Simply create a new file in your project root named tsconfig.json
and fill it with the following contents:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | { "compilerOptions" : { "outDir" : "./dist/" , "sourceMap" : true , "noImplicitAny" : true , "module" : "commonjs" , "target" : "es5" , "jsx" : "react" }, "files" : [ "./typings/index.d.ts" , "./src/components/Hello.tsx" , "./src/index.tsx" ] } |
We’re including typings/index.d.ts
, which Typings created for us. That file automatically includes all of your installed dependencies.
You can learn more about tsconfig.json
files here.
Please login to continue.