Skip to content

Commit 4f0286c

Browse files
author
Guillaume Chau
committedApr 10, 2019
perf(webpack dashboard): cleaning the analyzer data
1 parent 174c7d1 commit 4f0286c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
 

‎packages/@vue/cli-ui/ui-defaults/utils/modules.js

+2
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ function walkTreeToSortChildren (tree, sizeType) {
161161
}
162162
tree.children = Object.keys(tree.children).map(
163163
key => tree.children[key]
164+
).filter(
165+
child => child.size.stats > tree.size.stats * 0.01 && child.size.stats > 1024
164166
).sort((a, b) => b.size[sizeType] - a.size[sizeType])
165167
for (const child of tree.children) {
166168
child.previousSize = {

‎packages/@vue/cli-ui/ui-defaults/utils/stats.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@ exports.processStats = function (stats) {
2828
data: {
2929
errors: stats.data.errors,
3030
warnings: stats.data.warnings,
31-
assets: stats.data.assets,
32-
chunks: stats.data.chunks
31+
assets: stats.data.assets.map(a => ({
32+
name: a.name,
33+
size: a.size
34+
})),
35+
chunks: stats.data.chunks.map(c => ({
36+
id: c.id,
37+
names: c.names
38+
}))
3339
},
3440
computed: {
3541
modulesPerSizeType

0 commit comments

Comments
 (0)
Please sign in to comment.