Answer the question
In order to leave comments, you need to log in
How to import a module relative to the project root in typescript?
/app
|--/src
| |--currentfile.ts
| |--anotherfile.ts
|
|--/env
|--environment.ts
import { another } from './anotherfile';
import { environment } from 'env/environment';
Answer the question
In order to leave comments, you need to log in
The problem was solved in the following way.
Perhaps somewhere inattentively read the documentation.
In tsconfig.ts write:
{
"compilerOptions": {
"baseUrl": ".", // корень проекта, в данном случае директория, где лежит конфиг
"paths": [
"env/*": ["env/*"]
]
}
}
{
"compilerOptions": {
"baseUrl": ".", // корень проекта, в данном случае директория, где лежит конфиг
"paths": [
"env/*": ["env/*"]
]
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question