저는 프론트 엔드 개발과 angular2 앱에 약간의 문제가 있습니다. 아래의 타임 라인 캡처를 볼 수 있듯이각도 2 polyfills 초기화가 너무 오래 걸림
는 polyfills의 TAKS 너무 오랜 시간 (거의 육초는!) 그것은 정상이 보인다. 하지만,이 polyfills 시간을 줄이기 위해 내가 무엇을 할 수 있는지 전혀 모른다.
conf의 일부 줄.
// Add build specific plugins
if (ENV === 'build') {
config.plugins.push(
// Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin
// Only emit files when there are no errors
new webpack.NoErrorsPlugin(),
// Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin
// Dedupe modules in the output
new webpack.optimize.DedupePlugin(),
// Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
// Minify all javascript, switch loaders to minimizing mode
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
})
);
}
전체 webpack.config.js 내 앱에서 사용합니다. https://gist.github.com/jeesim2/484186d630fedc9f42e264ca905ad123
내 각 버전
"@angular/common": "^2.0.1",
"@angular/compiler": "^2.0.1",
"@angular/core": "^2.0.1",
"@angular/forms": "^2.0.1",
"@angular/http": "^2.0.1",
"@angular/platform-browser": "^2.0.1",
"@angular/platform-browser-dynamic": "^2.0.1",
"@angular/router": "^3.0.1",
webpack.optimize.UglifyJsPlugin은 70 % 패키지 크기를 감소하지만, 페이지 로딩 속도가 빨라되지 않았습니다.
왜이 긴 페이지로드가 발생합니까?