Skip to content

Commit

Permalink
Enable collections in LodashModuleReplacementPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Jun 24, 2017
1 parent d96c9c6 commit 284063d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ const CrumbTable = React.createClass({
},

renderData() {
let {kvData} = this.props;
if (!kvData || _.isEmpty(kvData)) {
if (!this.props.kvData) {
return null;
}
let tuples = _.map(kvData, (val, key) => [val, key]);

return tuples.map(([val, key]) => {
return _.map(this.props.kvData, (val, key) => [val, key]).map(([val, key]) => {
return (
<tr key={key}>
<td className="key">{key}</td>
Expand Down
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ var config = {
},
plugins: [
new LodashModuleReplacementPlugin({
shorthands: true
shorthands: true,
collections: true
}),
new webpack.optimize.CommonsChunkPlugin({
names: localeEntries.concat(['vendor']) // 'vendor' must be last entry
Expand Down

0 comments on commit 284063d

Please sign in to comment.