generated from JDBar/jwc-typescript-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsconfig.json
67 lines (66 loc) · 2.38 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
61
62
63
64
65
66
67
/**
* This file is used for configuring the TypeScript compiler.
* It might look intimidating, because it kind of is!
* But don't worry, you don't need to understand it all.
*
* If you'd like to learn more about how to choose compiler options, check out this page:
* https://www.typescriptlang.org/docs/handbook/modules/guides/choosing-compiler-options.html
*/
{
"compilerOptions": {
// Add React support
"jsx": "react",
// Compile to the latest version of JavaScript.
"target": "esnext",
// This must be specified if "paths" is. It specifies the base directory for resolving non-relative module names.
"baseUrl": ".",
// This allows us to use absolute imports in our code. For example, we can write `import foo from '@/foo'`
// instead of `import foo from '../../foo'`. The src/@types/ folder is for TypeScript type definitions for
// JavaScript modules that don't have any type definitions, if needed.
"paths": {
"*": ["src/@types/*"],
"@/*": ["src/*"]
},
// Include the latest version of JavaScript's standard library.
"lib": ["esnext", "DOM", "DOM.Iterable"],
// Allow JavaScript files to be compiled, in case you'd rather write in JavaScript instead of TypeScript.
"allowJs": true,
// Allow `import foo from 'foo'` instead of `import * as foo from 'foo'`.
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
// Enable strict type checking options. HIGHLY RECOMMENDED.
"strict": true,
// This allows us to import JSON files.
"resolveJsonModule": true,
// Put compiled files in the `build` folder (if noEmit is set to false)
"outDir": "./dist",
// This tells TypeScript how to resolve module names.
"module": "NodeNext",
"moduleResolution": "NodeNext",
// Allow us to import `.ts`, `.mts`, or `.tsx` files.
"allowImportingTsExtensions": true,
// Do not output any compiled files when we run tsc.
"noEmit": true,
// Add type safety for CSS modules
"plugins": [
{
"name": "typescript-plugin-css-modules",
"options": {
"rendererOptions": {
"sass": {
"includePaths": ["./"]
}
}
}
}
]
},
// This tells TypeScript to only compile files in the `src` folder
"include": ["./src"],
// This tells TypeScript not to compile files in the `dist` or `public` folder
"exclude": ["./dist", "./public"],
// Enables native ESM support, so you can use `.mts` file extension.
"ts-node": {
"esm": true
}
}