Skip to content

Commit 9297988

Browse files
evilebottnawihiroppy
authored andcommitted
fix: add client code for electron-renderer target (#1935)
1 parent bc83223 commit 9297988

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/utils/addEntries.js

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ function addEntries(config, options, server) {
7272
const webTarget =
7373
config.target === 'web' ||
7474
config.target === 'webworker' ||
75+
config.target === 'electron-renderer' ||
7576
config.target == null;
7677
const additionalEntries = checkInject(
7778
options.injectClient,

test/Entry.test.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ describe('Entry', () => {
283283
Object.assign({}, config),
284284
Object.assign({ target: 'web' }, config),
285285
Object.assign({ target: 'webworker' }, config),
286-
Object.assign({ target: 'node' }, config) /* index:3 */,
286+
Object.assign({ target: 'electron-renderer' }, config),
287+
Object.assign({ target: 'node' }, config) /* index:4 */,
287288
];
288289

289290
const devServerOptions = {};
@@ -292,7 +293,7 @@ describe('Entry', () => {
292293

293294
// eslint-disable-next-line no-shadow
294295
webpackOptions.forEach((webpackOptions, index) => {
295-
const expectInline = index !== 3; /* all but the node target */
296+
const expectInline = index !== 4; /* all but the node target */
296297

297298
expect(webpackOptions.entry.length).toEqual(expectInline ? 2 : 1);
298299

0 commit comments

Comments
 (0)