From c6b2b1f6154ad51228ac8cb571a96222c2fc7cef Mon Sep 17 00:00:00 2001 From: Evilebot Tnawi Date: Fri, 31 May 2019 19:21:21 +0300 Subject: [PATCH] fix: add client code for `node-webkit` target (#1942) --- lib/utils/addEntries.js | 1 + test/Entry.test.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/utils/addEntries.js b/lib/utils/addEntries.js index dba51bd177..fb5e542e75 100644 --- a/lib/utils/addEntries.js +++ b/lib/utils/addEntries.js @@ -73,6 +73,7 @@ function addEntries(config, options, server) { config.target === 'web' || config.target === 'webworker' || config.target === 'electron-renderer' || + config.target === 'node-webkit' || config.target == null; const additionalEntries = checkInject( options.injectClient, diff --git a/test/Entry.test.js b/test/Entry.test.js index 0e6de64c5f..0ee7538b82 100644 --- a/test/Entry.test.js +++ b/test/Entry.test.js @@ -284,7 +284,8 @@ describe('Entry', () => { Object.assign({ target: 'web' }, config), Object.assign({ target: 'webworker' }, config), Object.assign({ target: 'electron-renderer' }, config), - Object.assign({ target: 'node' }, config) /* index:4 */, + Object.assign({ target: 'node-webkit' }, config), + Object.assign({ target: 'node' }, config) /* index:5 */, ]; const devServerOptions = {}; @@ -293,7 +294,7 @@ describe('Entry', () => { // eslint-disable-next-line no-shadow webpackOptions.forEach((webpackOptions, index) => { - const expectInline = index !== 4; /* all but the node target */ + const expectInline = index !== 5; /* all but the node target */ expect(webpackOptions.entry.length).toEqual(expectInline ? 2 : 1);