Skip to content

Commit

Permalink
Code should be compatible with Node 4.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
QWp6t committed Sep 2, 2016
1 parent f6cee29 commit 054cd83
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion assets/build/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"root": false,
"extends": "airbnb",
"rules": {
"import/no-extraneous-dependencies": 0
"import/no-extraneous-dependencies": 0,
"prefer-rest-params": 0
}
}
16 changes: 10 additions & 6 deletions assets/build/util/mergeWithConcat.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

const mergeWith = require('lodash/mergeWith');

module.exports = (...args) => mergeWith(...args, (a, b) => {
if (Array.isArray(a) && Array.isArray(b)) {
return a.concat(b);
}
return undefined;
});
module.exports = function mergeWithConcat() {
const args = [].slice.call(arguments);
args.push((a, b) => {
if (Array.isArray(a) && Array.isArray(b)) {
return a.concat(b);
}
return undefined;
});
return mergeWith.apply(this, args);
};
2 changes: 2 additions & 0 deletions assets/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ const webpackConfig = {
],
};

module.exports = webpackConfig;

if (config.env.production) {
module.exports = mergeWithConcat(webpackConfig, webpackConfigProduction);
}
Expand Down

0 comments on commit 054cd83

Please sign in to comment.