Skip to content

Commit 9f2bc41

Browse files
authored
fix(webpack-plugin): add web as a target for the renderer process (#2285)
1 parent 7bbff3a commit 9f2bc41

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/plugin/webpack/src/WebpackConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export default class WebpackConfigGenerator {
215215
return webpackMerge({
216216
entry,
217217
devtool: this.sourceMapOption(),
218-
target: 'electron-renderer',
218+
target: ['web', 'electron-renderer'],
219219
mode: this.mode,
220220
output: {
221221
path: path.resolve(this.webpackDir, 'renderer'),

packages/plugin/webpack/test/WebpackConfig_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ describe('WebpackConfigGenerator', () => {
352352
} as WebpackPluginConfig;
353353
const generator = new WebpackConfigGenerator(config, mockProjectDir, false, 3000);
354354
const webpackConfig = await generator.getRendererConfig(config.renderer.entryPoints);
355-
expect(webpackConfig.target).to.equal('electron-renderer');
355+
expect(webpackConfig.target).to.deep.equal(['web', 'electron-renderer']);
356356
expect(webpackConfig.mode).to.equal('development');
357357
expect(webpackConfig.entry).to.deep.equal({
358358
main: ['rendererScript.js'],
@@ -397,7 +397,7 @@ describe('WebpackConfigGenerator', () => {
397397
} as WebpackPluginConfig;
398398
const generator = new WebpackConfigGenerator(config, mockProjectDir, true, 3000);
399399
const webpackConfig = await generator.getRendererConfig(config.renderer.entryPoints);
400-
expect(webpackConfig.target).to.equal('electron-renderer');
400+
expect(webpackConfig.target).to.deep.equal(['web', 'electron-renderer']);
401401
expect(webpackConfig.mode).to.equal('production');
402402
expect(webpackConfig.entry).to.deep.equal({
403403
main: ['rendererScript.js'],

0 commit comments

Comments
 (0)