Skip to content

Commit 8e53c36

Browse files
committed
Allow absolute include paths
This will make it possible to use 'src/path/to/file' imports instead of '../../' relative paths we were force to use
1 parent e37b0c4 commit 8e53c36

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tsconfig.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
/* Visit https://aka.ms/tsconfig.json to read more about this file */
3+
"$schema": "https://json.schemastore.org/tsconfig",
34
"compilerOptions": {
45
"module": "commonjs",
56
"target": "ES2021",
6-
"outDir": "out",
77
"lib": ["ES2021"],
8-
"sourceMap": true,
8+
"baseUrl": ".", // Base directory to resolve non-absolute module names.
99
"rootDir": "src",
10+
"outDir": "out",
1011

1112
/* Strict Type-Checking Option */
1213
"strict": true /* enable all strict type-checking options */,
@@ -30,10 +31,11 @@
3031

3132
/* Module Resolution Options */
3233
"moduleResolution": "node", // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6).
33-
"baseUrl": "./", // Base directory to resolve non-absolute module names.
34+
"resolveJsonModule": true, // Allows importing modules with a .json extension.
3435
"paths": {
3536
// A series of entries which re-map imports to lookup locations relative to the 'baseUrl'.
3637
// "app/*": ["src/app/*"]
38+
"src/*": ["src/*"]
3739
},
3840
// "rootDirs": [], // List of root folders whose combined content represents the structure of the project at runtime.
3941
"typeRoots": [
@@ -46,9 +48,9 @@
4648
"esModuleInterop": true, // Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'.
4749
// "preserveSymlinks": true, // Do not resolve the real path of symlinks.
4850
// "allowUmdGlobalAccess": true, // Allow accessing UMD globals from modules.
49-
"resolveJsonModule": true, // Allows importing modules with a .json extension.
5051

5152
/* Source Map Options */
53+
"sourceMap": true,
5254
// "sourceRoot": "", // Specify the location where debugger should locate TypeScript files instead of source locations.
5355
// "mapRoot": "", // Specify the location where debugger should locate map files instead of generated locations.
5456
// "inlineSourceMap": true, // Emit a single file with source maps instead of having a separate file.

0 commit comments

Comments
 (0)