发生未处理的异常:工作区中未设置配置“es5”。
当客户希望项目在 Internet Explorer 8 上运行时,问题就开始了。幸运的是,新的 angular 8 提供了差异加载。
根据angular的文档(https://angular.io/guide/deployment#differential-loading),我将es5 JSON添加到angular.json然后我尝试使用'ng serve --configuration es5'提供服务
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"sm": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"style": "sass"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/Forex-Lottery-Front-End",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/font-awesome/scss/font-awesome.scss",
"./node_modules/bootstrap/dist/css/bootstrap.css",
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/scss/styles.scss"
],
"scripts": [
"./node_modules/jquery/dist/jquery.js"
],
"es5BrowserSupport": true
}, …Run Code Online (Sandbox Code Playgroud)