- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在为一个项目使用最新的 angular-cli (beta-18)。我知道 cli 仍处于非常早期的阶段,但我很困惑为什么我的最终包大小在没有 AoT 的情况下实际上更小。
当我运行 ng build --prod
时,它是 1.08 mb:
Asset Size Chunks Chunk Names
main.53d637ff9422b65418e6.bundle.js 1.08 MB 0, 2 [emitted] main
styles.01cffb95000fdb84402c.bundle.js 8.9 kB 1, 2 [emitted] styles
inline.js 1.45 kB 2 [emitted] inline
main.53d637ff9422b65418e6.bundle.map 7.24 MB 0, 2 [emitted] main
styles.01cffb95000fdb84402c.bundle.map 40.3 kB 1, 2 [emitted] styles
inline.d41d8cd98f00b204e980.bundle.map 13.5 kB 2 [emitted] inline
main.53d637ff9422b65418e6.bundle.js.gz 236 kB [emitted]
index.html 907 bytes [emitted]
assets/.npmignore 0 bytes [emitted]
favicon.ico 5.43 kB [emitted]
当我运行 ng build --prod --aot
时,它是 1.26 mb。
Asset Size Chunks Chunk Names
styles.01cffb95000fdb84402c.bundle.map 40.3 kB 1, 2 [emitted] styles
0.688d48f52a362bd543fc.bundle.map 2.94 kB [emitted]
styles.01cffb95000fdb84402c.bundle.js 8.9 kB 1, 2 [emitted] styles
inline.js 1.45 kB 2 [emitted] inline
main.6490041404a193461c3c.bundle.map 6.81 MB 0, 2 [emitted] main
main.6490041404a193461c3c.bundle.js 1.26 MB 0, 2 [emitted] main
inline.d41d8cd98f00b204e980.bundle.map 13.5 kB 2 [emitted] inline
main.6490041404a193461c3c.bundle.js.gz 223 kB [emitted]
index.html 907 bytes [emitted]
assets/.npmignore 0 bytes [emitted]
favicon.ico 5.43 kB [emitted]
对于 tsconfig 看起来像:
{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es6",
"dom"
],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
},
"exclude": [
"**/*.spec.ts"
]
}
最佳答案
我在 issue on our GitHub 上回答了这个问题,但这里是我的答案以供引用:
如果您使用的某些库不支持 AoT(并发布 UMD bundle ),则可能会发生这种情况。原因是我们无法优化纯 JavaScript 的组件。不幸的是,这不是我们可以解决的问题。
这些库需要公开 ES2015 模块,移除装饰器并且组件/模块已经 AOT 编译。我们正在为支持 JIT 和 AoT 编译的库制定指南。
此外,有时对于某些模板,AoT 大小可能大于 JIT。 gzipped 版本应该是相反的,因为大多数 AoT 内容都是一遍又一遍重复的相同语句。
虽然包更大,但引导时间应该明显更快。
关于Angular2 CLI : why bundle size of "--prod" smaller than "--prod --aot"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40205903/
ValueError Traceback (most recent call last) in 23 out
在 CSS 中,我从来没有真正理解为什么会发生这种情况,但每当我为某物分配 margin-top:50% 时,该元素就会被推到页面底部,几乎完全消失这一页。我假设 50% 时,该元素将位于页面的中间位
我正在尝试在 pyTorch 中训练我的第一个神经网络(我不是程序员,只是一个困惑的化学家)。 网络本身应该采用 1064 个元素向量并用 float 对它们进行评级。 到目前为止,我遇到了各种各样的
我有一个简单的问题。如何在 3 个维度上移动线性阵列?这似乎太有效了,但在 X 和 Y 轴上我遇到了索引问题。我想这样做的原因很简单。我想创建一个带有 block 缓冲区的体积地形,所以我只需要在视口
我正在尝试运行我购买的一本关于 Pytorch 强化学习的书中的代码。 代码应该按照本书工作,但对我来说,模型没有收敛,奖励仍然为负。它还会收到以下用户警告: /home/user/.local/li
我目前正在使用 this repo使用我自己的数据集执行 NLP 并了解有关 CNN 的更多信息,但我一直遇到有关形状不匹配的错误: ValueError: Target size (torch.Si
UIScrollView 以编程方式设置,请不要使用 .xib 文件发布答案。 我的 UIScrollView 位于我的模型类中,所以我希望代码能够轻松导入到另一个项目中,例如。适用于 iPad 或旋
我在我的 Ruby on Rails 应用程序(版本 4.3.1)中使用 Bootstrap gem。我最近发现了响应式字体大小功能 (rfs)。根据 Bootstrap 文档,它刚刚在 4.3 版中
这个问题不太可能帮助任何 future 的访客;它仅与一个小地理区域、一个特定时刻或一个非常狭窄的情况相关,而这些情况通常不适用于互联网的全局受众。如需帮助使这个问题更广泛地适用,visit the
size 之间的语义区别是什么?和 sizeIs ?例如, List(1,2,3).sizeIs > 1 // true List(1,2,3).size > 1 // true Luis 在 c
我想从 div 中删除一些元素属性。我的 div 是自动生成的。我想遍历每个 div 和子 div,并想删除所有 font-size (font-size: Xpx)和 size里面font tag
super ,对 Python 和一般编程 super 新手。我有一个问题应该很简单。我正在使用一本使用 Python 3.1 版的 python 初学者编程书。 我目前正在写书中的一个程序,我正在学
我无法从 NativeBase 更改缩略图的默认大小。我可以显示默认圆圈,即小圆圈和大圆圈,但我想显示比默认大小更大的圆圈。这是我的缩略图代码: Prop 大小不起作用,缩略图仍然很小。 我的 Na
我是pytorch的新手。在玩张量时,我观察到了两种类型的张量- tensor(58) tensor([57.3895]) 我打印了它们的形状,输出分别是 - torch.Size([]) torch
这是我的 docker images 命令的输出: $ docker images REPOSITORY TAG IMAGE ID CREATED
来自 PriorityQueue 的代码: private E removeAt(int i) { assert i >= 0 && i < size; modCount++;
首先,在我的系统上保留以下内容:sizeof(char) == 1 和 sizeof(char*) == 4。很简单,当我们计算下面类的总大小时: class SampleClass { char c
我正在编写一个游戏来查找 2 个图像之间的差异。我创建了 CCSprite 的子类 Spot。首先我尝试创建小图像并根据其位置添加自身,但后来我发现位置很难确定,因为很难避免 1 或 2 个像素的偏移
我有一个 Tumblr Site每个帖子的宽度由标签决定。 如果一篇文章被标记为 #width200,CSS 类 .width200 被分配。 问题是,虽然帖子的宽度不同,但它们都使用主题运算符加载相
这个问题在这里已经有了答案: What is the ideal growth rate for a dynamically allocated array? (12 个答案) 关闭 8 年前。 我
我是一名优秀的程序员,十分优秀!