我安装了全局安装source-map-explorer需要减少分发包文件以优化分析
- 具有预加载功能的延迟加载模块。
- 为图片和JS文件配置的Gulp压缩。
因此需要减少bundle JS文件,我在angular 6项目中没有看到webpack.conf reference link文件。
$ npm install -g source-map-explorer
package.json
{
"name": "cfch",
"version": "0.0.0",
"main": "gulpfile.js",
"scripts": {
"ng": "ng",
"start": "gulp && ng serve --proxy-config proxy.conf.json",
"build": "ng build --prod --source-map gulp",
"prebuild": "gulp"
},
"dependencies": {
"@angular/animations": "^6.1.0",
"@angular/cdk": "^6.1.0",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"gulp-htmlmin": "^5.0.1",
"gulp-imagemin": "^5.0.3",
"gulp-minify-css": "^1.2.4",
"gulp-uglify": "^3.0.1",
"ts-xlsx": "0.0.11",
"webpack-sources": "^1.3.0",
},
"devDependencies": {
"source-map-explorer": "^1.7.0",
}
Note:vendor.js and main.js 2.4MB and 222KB