问题
I'm using angular 6+ while npm start project in local system it's take above 12 seconds to perform application .
When initial load page vendor and main js file size too big so how could I reduce size?.
1.I tried to remove style in my html code. 2. Removed un-necessary import class.(Angular)
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
}
}
},
来源:https://stackoverflow.com/questions/53882154/angular-6-vendor-and-main-js-scripting-size-decrease