From 64c64ff0993081ce7ef9228ef5f49944f083d658 Mon Sep 17 00:00:00 2001 From: "Haddix, Steven" Date: Thu, 2 Feb 2017 09:20:59 -0500 Subject: [PATCH] Wrapped entries in arrays. Updated webpack-merge & corresponding tests. --- package.json | 2 +- src/webpackUtils.js | 2 +- tests/webpackUtils.test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cbefb37..b1439cc 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "redux": "^3.6.0", "uuid": "^3.0.0", "webpack": "^1.13.3", - "webpack-merge": "^1.0.1", + "webpack-merge": "^2.6.1", "webpack-sources": "^0.1.2" }, "nyc": { diff --git a/src/webpackUtils.js b/src/webpackUtils.js index e280392..317bb61 100644 --- a/src/webpackUtils.js +++ b/src/webpackUtils.js @@ -117,7 +117,7 @@ export function generateConfiguration(entries = [], configuration = {}) { } entries.forEach((entry) => { - config.entry[entry.key] = entry.file; + config.entry[entry.key] = [entry.file]; }) return config; diff --git a/tests/webpackUtils.test.js b/tests/webpackUtils.test.js index e9e8060..bdb03a9 100644 --- a/tests/webpackUtils.test.js +++ b/tests/webpackUtils.test.js @@ -136,7 +136,7 @@ test('generateConfiguration', (t) => { const generatedConfig = generateConfiguration(entries, configuration); - t.deepEqual(generatedConfig.entry, { key1: 'file1', key2: 'file2' }, 'should add entries to configuration'); + t.deepEqual(generatedConfig.entry, { key1: ['file1'], key2: ['file2'] }, 'should add entries to configuration'); t.equal(generatedConfig.module.loaders[1].loader, 'someLoader', 'should merge additional configurations with base configuration'); t.end() })