Angular Visual Studio代码可以';t解析角度';s tsconfig.base路径
我在Angular 9的tsconfig.base.json中添加了一个自定义路径,所有组件和所有东西都可以完美加载。但visual Studio代码正在抱怨并抛出错误,无法在我的应用程序路由模块和应用程序模块中找到模块。如何解决这个问题 tsconfig.base.json-Angular Visual Studio代码可以';t解析角度';s tsconfig.base路径,angular,typescript,Angular,Typescript,我在Angular 9的tsconfig.base.json中添加了一个自定义路径,所有组件和所有东西都可以完美加载。但visual Studio代码正在抱怨并抛出错误,无法在我的应用程序路由模块和应用程序模块中找到模块。如何解决这个问题 tsconfig.base.json- { "compileOnSave": false, "compilerOptions": { "baseUrl": "./", "paths": { "@/*": ["src/app/*"
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": ["src/app/*"],
"@env/*": ["src/environments/*"]
},
"outDir": "./dist/out-tsc",
"sourceMap": true,
....
}
应用程序模块-
import { AppRoutingModule, routingComponents } from '@/app-routing.module';
import { AppComponent } from '@/app.component';
也许你编辑错了文件,。。
我也使用angular 9.0,我在tsconfig.json中进行了相同的配置,而不是tsconfig.base.json您能提供stackblitz吗?您在vscode或终端中遇到错误了吗?尝试重新启动服务器。