mirror of
https://github.com/primer/css.git
synced 2025-01-05 21:22:57 +03:00
Merge pull request #879 from primer/fix-bundle-size-report
Fix bundle size report
This commit is contained in:
commit
9efaffad61
@ -44,10 +44,15 @@ Promise.all(
|
|||||||
const entry = {
|
const entry = {
|
||||||
name: bundle.name,
|
name: bundle.name,
|
||||||
path: bundle.css,
|
path: bundle.css,
|
||||||
local: require(`../${bundle.stats}`)
|
local: require(`../${bundle.stats}`),
|
||||||
|
remote: {}
|
||||||
}
|
}
|
||||||
return fetch(unpkgBaseURL + bundle.stats)
|
return fetch(unpkgBaseURL + bundle.stats)
|
||||||
.then(res => res.json())
|
.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(stats => (entry.remote = stats))
|
||||||
.then(() => entry)
|
.then(() => entry)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user