Skip to content

Commit 6964be2

Browse files
committed
create empty stats for new bundles
1 parent 8048e9a commit 6964be2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

script/bundle-size-report

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env node
22
const fetch = require('node-fetch')
33
const filesize = require('filesize')
4+
const cssstats = require('cssstats')
45
const minimist = require('minimist')
56
const {green, gray, yellow, red} = require('colorette')
67
const {table, getBorderCharacters} = require('table')
@@ -50,8 +51,8 @@ Promise.all(
5051
return fetch(unpkgBaseURL + bundle.stats)
5152
.then(res => res.json())
5253
.catch(error => {
53-
console.warn(`Unable to fetch old ${bundle.name} bundle from unpkg; assuming it's new!`)
54-
return entry.local
54+
console.warn(`Unable to fetch old "${bundle.name}" stats from unpkg; assuming it's new!`)
55+
return cssstats('')
5556
})
5657
.then(stats => (entry.remote = stats))
5758
.then(() => entry)

0 commit comments

Comments
 (0)