Skip to content

Commit

Permalink
fix: add client code for electron-renderer target (#1935)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored and hiroppy committed May 29, 2019
1 parent bc83223 commit 9297988
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/utils/addEntries.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions test/Entry.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand All @@ -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);

Expand Down

0 comments on commit 9297988

Please sign in to comment.