Skip to content

Commit 8ae4c2e

Browse files
committed
Fixed error when running on node < 8.4, due to use of spread operator
1 parent 940f569 commit 8ae4c2e

2 files changed

Lines changed: 23 additions & 24 deletions

File tree

src/webpack.haul.extend.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ const originalConfig = require('../../../webpack.haul.js');
33

44
module.exports = function(context, config) {
55
config = originalConfig(context, config);
6-
return {
7-
...config,
8-
plugins: [
9-
...(config.plugins || []),
10-
new Visualizer()
11-
]
12-
};
6+
return Object.assign(
7+
{},
8+
config,
9+
{
10+
plugins: (config.plugins || []).concat([new Visualizer()])
11+
}
12+
);
1313
};

src/webpack.haul.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@ const Visualizer = require('webpack-visualizer-plugin');
33
module.exports = ({platform}, {module, plugins}) => {
44
return {
55
entry: `./index.${platform}.js`,
6-
module: {
7-
...module,
8-
rules: [
9-
{
10-
test: /\.js?$/,
11-
exclude: '/node_modules/',
12-
use: [{
13-
loader: 'babel-loader'
14-
}]
15-
},
16-
...module.rules
17-
]
18-
},
19-
plugins: [
20-
...(plugins || []),
21-
new Visualizer()
22-
]
6+
module: Object.assign(
7+
{},
8+
module,
9+
{
10+
rules: [
11+
{
12+
test: /\.js?$/,
13+
exclude: '/node_modules/',
14+
use: [{
15+
loader: 'babel-loader'
16+
}]
17+
}
18+
].concat(module.rules || [])
19+
}
20+
),
21+
plugins: (plugins || []).concat([new Visualizer()])
2322
};
2423
};

0 commit comments

Comments
 (0)