Javascript 运行angular 8生产时:在严格模式下删除不合格标识符
当我在生产模式下编译angular8(cli)项目时Javascript 运行angular 8生产时:在严格模式下删除不合格标识符,javascript,angular,Javascript,Angular,当我在生产模式下编译angular8(cli)项目时 ng build--aot=true--prod--optimization=true--buildOptimizer=true 然后,当我将dist放入文件服务器并打开浏览器时,控制台和黑屏中出现错误: 未捕获的语法错误:在严格模式下删除非限定标识符。 main-es2015.4c04714d1d600593094f.js:1 当我打开main es…jsjs文件时,我看到 hasWebGL:function(){ 如果(!window.
ng build--aot=true--prod--optimization=true--buildOptimizer=true
然后,当我将dist
放入文件服务器并打开浏览器时,控制台和黑屏中出现错误:
未捕获的语法错误:在严格模式下删除非限定标识符。main-es2015.4c04714d1d600593094f.js:1 当我打开
main es…js
js文件时,我看到
hasWebGL:function(){
如果(!window.WebGLRenderingContext)
返回0;
var e=document.createElement(“画布”)
,t=e.getContext(“webgl2”);
返回t?2:(t=e.getContext(“实验性webgl2”))?2:(t=e.getContext(“webgl”))| |(t=e.getContext(“实验性webgl”)?1:0
}(),
hasCursorLock:(p=document.createElement(“画布”),p.requestPointerLock | | p.mozRequestPointerLock | | p.webkitRequestPointerLock | p.msRequestPointerLock?1:0),
hasFullscreen:函数(){
var e=document.createElement(“画布”);
返回(e.requestFullScreen | e.mozRequestFullScreen | e.msRequestFullscreen | e.webkitRequestFullScreen)&(-1==s.indexOf(“Safari”)| l>=10.1)?1:0
}(),
hasThreads:“未定义”!=SharedArrayBuffer的类型,
hasWasm:“object”==typeof WebAssembly&“function”==typeof WebAssembly.validate&&“function”==typeof WebAssembly.compile,
hasWasmThreads:function(){
如果(“对象”!=WebAssembly的类型)
返回!1;
如果(“未定义”==SharedArrayBuffer的类型)
返回!1;
var e=新的WebAssembly.Memory({
首字母:1,
最大值:1,
共享:!0
})
,t=e.SharedArrayBuffer的缓冲区实例;
返回删除e,t//这里有问题!!!!!!!!
}()
好的-我错了。在我的一个角度项目文件中,我使用外部库的导入
import '../../../../assets/unity3d/Build/UnityLoader.js';
import '../../../../assets/unity3d/TemplateData/UnityProgress.js';
declare var UnityLoader : any;
declare var UnityProgress : any;
忘记了插入它们来构建文件main-es20…js
。
该导入代码的角度力严格模式
,这会在该库中导致错误。当我删除导入(但保留了声明语句)和index.html中
标记中的链接库时(其中严格模式默认为关闭),一切正常,没有任何错误