嗨,我通过以下方式构建了我的 Angular 6 应用程序:
ng build --prod --build-optimizer --stats-json
命令,这是我的结果..检查此图像:
我的应用程序有很多组件 main.ts 文件大小有点高即使我使用 gzip 用户必须下载至少 1 兆...
我想知道两件事:
1.accroding我的图片制作文件大小正常???
2-任何减少main.ts大小的方法?
谢谢
我的 package.json:
{
"name": "m4new",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"analyze": "ng build --prod --stats-json && webpack-bundle-analyzer dist/m4user/stats.json"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.0.1",
"@angular/cdk": "^6.0.1",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/flex-layout": "^5.0.0-beta.14",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/material": "^6.0.1",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/router": "^6.0.0",
"@auth0/angular-jwt": "^1.1.0",
"@kolkov/angular-editor": "^0.8.6",
"@mdi/font": "^2.2.43",
"angular-typing-animation": "^0.5.4",
"chart.js": "^2.7.2",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"jalali-moment": "^3.1.2",
"jquery": "^3.3.1",
"jwt-decode": "^2.2.0",
"materialize-css": "^0.100.2",
"mdi": "^2.2.43",
"ngx-uploader": "^4.3.0",
"rxjs": "^6.0.0",
"rxjs-compat": "^6.1.0",
"sweetalert": "^2.1.0",
"videogular2": "^6.0.6",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.6.1",
"@angular/cli": "~6.0.1",
"@angular/compiler-cli": "^6.0.0",
"@angular/language-service": "^6.0.0",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.7.2",
"webpack-bundle-analyzer": "^2.13.1"
}
}
//////////////////////////webpackanalyzer 图像 ////////////: