Skip to content

Conversation

hhsnopek
Copy link
Contributor

No description provided.

lib/config.js Outdated
for (let key in res.entry) {
let value = res.entry[key]
if (typeof value === 'string') res.entry[key] = Array(value)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you can do res.entry[key] = Array.prototype.concat(res.entry[key]) here to one-line it 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 done!

lib/config.js Outdated
// webpack must consume an array for the value in our entry object
for (let key in res.entry) {
if (typeof value === 'string') res.entry[key] = Array.prototype.concat(res.entry[key])
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry you can actually leave out the type check as well, this will leave an array as an array but coerce a string. Also could you add a test for this? 👼 🙇

@hhsnopek
Copy link
Contributor Author

@jescalan everything should be in order here

@jescalan
Copy link
Member

This looks fantastic. Thank you!

@jescalan jescalan merged commit 3929e60 into static-dev:master Dec 19, 2016
@hhsnopek hhsnopek deleted the hs.entry branch December 19, 2016 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants