From 9297988154f64ca95da31a7ada4a41dff2073fb7 Mon Sep 17 00:00:00 2001 From: Evilebot Tnawi Date: Wed, 29 May 2019 23:05:51 +0300 Subject: [PATCH] fix: add client code for `electron-renderer` target (#1935) --- 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 aa9f621fe4..dba51bd177 100644 --- a/lib/utils/addEntries.js +++ b/lib/utils/addEntries.js @@ -72,6 +72,7 @@ function addEntries(config, options, server) { const webTarget = config.target === 'web' || config.target === 'webworker' || + config.target === 'electron-renderer' || config.target == null; const additionalEntries = checkInject( options.injectClient, diff --git a/test/Entry.test.js b/test/Entry.test.js index 7a6f354173..0e6de64c5f 100644 --- a/test/Entry.test.js +++ b/test/Entry.test.js @@ -283,7 +283,8 @@ describe('Entry', () => { Object.assign({}, config), Object.assign({ target: 'web' }, config), Object.assign({ target: 'webworker' }, config), - Object.assign({ target: 'node' }, config) /* index:3 */, + Object.assign({ target: 'electron-renderer' }, config), + Object.assign({ target: 'node' }, config) /* index:4 */, ]; const devServerOptions = {}; @@ -292,7 +293,7 @@ describe('Entry', () => { // eslint-disable-next-line no-shadow webpackOptions.forEach((webpackOptions, index) => { - const expectInline = index !== 3; /* all but the node target */ + const expectInline = index !== 4; /* all but the node target */ expect(webpackOptions.entry.length).toEqual(expectInline ? 2 : 1);