-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Description
Soo according to the documentation here:
https://www.typescriptlang.org/docs/handbook/module-resolution.html
And this proposal here:
#5039
I've tried to set up a simple typescript project using the paths and baseUrl path mapping to create shortcuts to folders.
Everything seemed fine in vscode but when i executed tsc from the commandline i found out its not working properly.
TypeScript Version:
Version 2.3.3
Code
tsconfig.json
{
"compilerOptions": {
"outDir": "./build/assets/js/",
"sourceMap": true,
"noImplicitAny": true,
"module": "commonjs",
"target": "es5",
"allowJs": true,
"baseUrl": "",
"paths": {
"@Core/*": [
"source/Core/*"
]
}
}
}
Currently the following code is not resolved in tsc, and only resolved in vs code.
import { Test } from "@Core/Test"
This outputs an error that @Core/Test module is not found
Expected behavior:
It should resolve to:
import { Test } from "../../Test"
Actual behavior:
It stays the same in the output file, and is not resolved.
import { Test } from "@Core/Test"