Skip to content

Commit

Permalink
fix: only use version if there is one (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie authored and egoist committed Mar 22, 2019
1 parent 1cb1fea commit 98c8d27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ensureCachePath = co.wrap(function*() {

module.exports = co.wrap(function*(name, opts = {}) {
const outDir = yield ensureCachePath()
const parsed = name.split(',').map(parse)
let parsed = name.split(',').map(parse)

// When you run `package-size ./dist/index.js,react`
// Or `package-size react-dom,react --cwd`
Expand Down Expand Up @@ -242,7 +242,7 @@ module.exports = co.wrap(function*(name, opts = {}) {
versionedName: parsed
.map(
pkg =>
`${pkg.name}${pkg.path ? `/${pkg.path}` : ''}@${packageInfo[pkg.name].version}`
`${pkg.name}${pkg.path ? `/${pkg.path}` : ''}${packageInfo[pkg.name] ? `@${packageInfo[pkg.name].version}` : ''}`
)
.join(','),
size: asset.size - 2753, // minus webpack runtime size
Expand Down

0 comments on commit 98c8d27

Please # to comment.