1
1
mirror of https://github.com/primer/css.git synced 2024-12-12 10:47:14 +03:00

Merge pull request #879 from primer/fix-bundle-size-report

Fix bundle size report
This commit is contained in:
Shawn Allen 2019-09-04 15:13:04 -07:00 committed by GitHub
commit 9efaffad61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,10 +44,15 @@ Promise.all(
const entry = {
name: bundle.name,
path: bundle.css,
local: require(`../${bundle.stats}`)
local: require(`../${bundle.stats}`),
remote: {}
}
return fetch(unpkgBaseURL + bundle.stats)
.then(res => res.json())
.catch(error => {
console.warn(`Unable to fetch old ${bundle.name} bundle from unpkg; assuming it's new!`)
return entry.local
})
.then(stats => (entry.remote = stats))
.then(() => entry)
})