Cod*_*n25 5 browser polyfills typescript angular angular8
我们已经将 Angular 应用从 7.2 版更新到了 8 版。更新过程到目前为止已经有效,该应用程序可以像往常一样在 Chrome、Firefox 开发者版、Safari、Opera 上以生产模式(在服务器上)本地使用。
但是在普通的火狐浏览器和 Waterfox 中,该应用程序不起作用:
我们创建了一个包含以下内容的浏览器列表文件:
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
Run Code Online (Sandbox Code Playgroud)
我们的 tsconfig 看起来像这样:
{
"compileOnSave": false,
"compilerOptions": {
"downlevelIteration": true,
"importHelpers": true,
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2015",
"typeRoots": [
"Node_modules / @ types"
]
"lib": [
"ES2016"
"Dom"
]
"module": "esnext"
}
}
Run Code Online (Sandbox Code Playgroud)
以及 angular.json 中带有 ssl 配置的区域,因此:
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "farm-management-ui:build",
"port": 8080,
"ssl": true,
"proxyConfig": "src/proxy.conf.js"
},
Run Code Online (Sandbox Code Playgroud)
我们已经成功执行了以下命令:
ng update @ angular / cli --from 7 --to 8 --migrate - 仅
ng update @ angular / core - from 7 - to 8 --migrate-only
而且我有一种感觉,如果该应用程序在 Firefox 中运行,则会创建一个无限循环,因为我也无法打开其他网页,例如 Stackoverflow 等。
为什么 Firefox 突然有这种行为,我们该如何解决?