-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tsconfig.json
60 lines (49 loc) · 2.21 KB
/
tsconfig.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
// This attribute will hold all the compile option of TypeScript
"compilerOptions": {
// Where are located your source code
"rootDir": "src",
// Where you want to put our compiled code
"outDir": "build",
// Which ES library you want to include
// If the project will be used as a server, no browser, then use the esnext or one of the last version)
// Otherwise, you I advice using ES6 but you still can use an advance ES version
// If you omit the option it will use
// For --target ES5: DOM,ES5,ScriptHost
// For --target ES6: DOM,ES6,DOM.Iterable,ScriptHost
"lib": ["es2018"],
// Which ES version you want to target during compilation, this is reliable to the `lib` option
// This options is really important regarding the project usage too (back or front)
// Put ES5 if you need to IE compatibility, otherwise you can target at least es2017 or es2018
// Tip: Take a look at this here if you need to know which feature is available depending of your Node version
// @see https://node.green
"target": "es2018",
// Depends how you want to resolve your module, TypeScript tends to use the `classic` way but let's
// stick with the `node` one
// @see https://www.typescriptlang.org/docs/handbook/module-resolution.html
"moduleResolution": "node",
// From documentation, Specify module code generation
// commonjs === (target = ES3 OR ES5)
// Otherwise use es6
// Fixes "The ESM Module Loader is Experimental" Error
"module": "commonjs",
// Sourcemap is usefull for the debugging part
// During dev you should active this one and then disable it in production
"sourceMap": true,
// Reolve `.json`file without tricking with a custom and bad json.d.ts file
"resolveJsonModule": true,
// Allow to import node module without `import *`
// Ex import express from 'express'
"esModuleInterop": true,
// don't produce comments in out directory
"removeComments": true,
// WARNING will not produce js if there are errors in code
"noEmitOnError": true
},
// The folder or files you want to exclude
// You can also use regex `**/*.spec.ts` for ex
"exclude":[
"node_modules",
"build"
]
}