Angular10
中配置@路径别名Angular10
中的项目文件结构 中文网站
Angular10
中的tsconfig
配置被分成了四个文件
tsconfig.json
工作空间中各项目的默认TS
P配置tsconfig.base.json
工作空间的所有项目使用的基础TS
配置,所有其它的配置文件都是继承自这个基础文件tsconfig.app.json
应用专属的TS
配置包括TS
和Angular
模板编译器的选项tsconfig.spec.json
应用测试的TS
配置tsconfig.base.json
中因为在TS
的配置中有介绍,在compilerOptions
中添加字段paths
来进行声明映射
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"module": "es2020",
"lib": ["es2018", "dom"],
"paths": {
"@/*": ["src/*"]
}
}
}
之后使用@/
就相当于使用src/
使用了@/
没有使用@/
本文地址:https://blog.csdn.net/weixin_43972992/article/details/107410198
如对本文有疑问, 点击进行留言回复!!
androidx+viewpage+tablayout+json开发(加载图片和视频)
网友评论