Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
354 views
in Technique[技术] by (71.8m points)

为什么angular-cli aot build的体积会明显大于aot serve的体积

ng build --aot -prod

以下为文件体积(aot build)
图片描述

ng serve --aot -prod

以下为文件体积(aot serve)
图片描述

build出来的体积实在无法接受,为什么这里aot serve打包出来的体积会明显小于aot build,如果这样的话,我在服务器上搭建开发环境,然后用aot serve,请求再转发到后台不是更好?

我理解的aot serve就是用aot build打包之后启动一个web容器供前端开发调试,所以这里体积差别这么大,让我产生很大疑惑

版本信息:

@angular/cli: 1.0.0
node: 6.9.1
os: darwin x64
@angular/animations: 4.0.0
@angular/common: 4.0.0
@angular/compiler: 4.0.0
@angular/core: 4.0.0
@angular/forms: 4.0.0
@angular/http: 4.0.0
@angular/platform-browser: 4.0.0
@angular/platform-browser-dynamic: 4.0.0
@angular/platform-server: 4.0.0
@angular/router: 4.0.0
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.0

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

配置文件发上来看看


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...