我在本地系统中的 npm start 项目中使用的是角度6+ 花费超过12秒的时间来执行申请。
当初始加载页面供应商和主要js文件大小太大时如何 我可以减小尺寸吗?。
1。我试图删除html代码中的样式。 2.删除了不必要的导入类。(角度)
Package.json:
/ "devDependencies": {
"@angular-devkit/build-angular": "^0.8.8",
"@angular/cli": "^6.2.8",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "^2.8.14",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.3.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
}
angular.json
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},