[我正在尝试将tsconfig.json文件中的打字稿目标从'es5'更改为'es2015',但是当我运行“ ng build”命令时,出现此错误:
Generating ES5 bundles for differential loading...
An unhandled exception occurred: vendor-es2015.js: 'with' in strict mode (476530:0)
476528 | module.exports = function(obj){
476529 | var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
> 476530 | with(obj||{}){
我的tsconfig.json文件是:
{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es6", "dom" , "es2017" ],
"mapRoot": "./",
"module": "esnext",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "ES2015",
"typeRoots": [
"../node_modules/@types"
],
"baseUrl": ".",
"paths": {
"@abp/*": [ "../node_modules/abp-ng2-module/dist/src/*" ],
"@app/*": [ "./app/*" ],
"@shared/*": [ "./shared/*" ],
"@node_modules/*": [ "../node_modules/*" ]
}
},
"exclude": [
"node_modules"
]
}
我在删除包后在package-lock.json中找到了已弃用的包ng构建工作正常;
要查找已弃用的软件包,请参见错误日志文件堆栈跟踪