在 Angular CLI 7.2 中不推荐使用 vendorSourceMap [英] vendorSourceMap deprecated in Angular CLI 7.2
问题描述
从 Angular 7.2
开始,vendorSourceMap
选项被弃用:
Starting with Angular 7.2
, the vendorSourceMap
option is deprecated:
> ng serve --vendor-source-map
Option "vendorSourceMap" is deprecated.
ng serve 的官方文档说 vendorSourceMap
已弃用,但没有给出解决库源的替代方法:
Official documentation of ng serve says vendorSourceMap
is deprecated, but gives no alternative way of resolving library sources:
--vendorSourceMap=true|false
--vendorSourceMap=true|false
已弃用
解决供应商包源映射.
默认值:false
在 Angular 7.2 中解析供应商源映射的正确的、非弃用的方法是什么?
What is the correct, non-deprecated way, then to resolve vendor source maps in Angular 7.2?
推荐答案
正确的 angular.json
选项是
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"sourceMap": {
"scripts": true,
"styles": true,
"vendor": true
},
...
在 10.0.*
上验证.(从 7.2.15
> 10.0.*
更新验证版本)
Verified on 10.0.*
.
(Updated verfied version from 7.2.15
> 10.0.*
)
顺便说一句,关于这个问题的文档真的很糟糕,我找不到博客文章或带有示例的资源.
Btw, the documentation is really poor on this matter, and I could not find a blog post or resource with an example.
这篇关于在 Angular CLI 7.2 中不推荐使用 vendorSourceMap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!