Skip to content

Commit 20e0f78

Browse files
committed
Merge pull request webpack#1467 from chentsulin/patch-1
`electron-main` and `electron-renderer` targets
2 parents ede0166 + f870006 commit 20e0f78

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

lib/WebpackOptionsApply.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ WebpackOptionsApply.prototype.process = function(options, compiler) {
114114
break;
115115
case "atom":
116116
case "electron":
117+
case "electron-main":
117118
var NodeTemplatePlugin = require("./node/NodeTemplatePlugin");
118119
var NodeTargetPlugin = require("./node/NodeTargetPlugin");
119120
var ExternalsPlugin = require("./ExternalsPlugin");
@@ -146,6 +147,37 @@ WebpackOptionsApply.prototype.process = function(options, compiler) {
146147
new LoaderTargetPlugin(options.target)
147148
);
148149
break;
150+
case "electron-renderer":
151+
var JsonpTemplatePlugin = require("./JsonpTemplatePlugin");
152+
var NodeTargetPlugin = require("./node/NodeTargetPlugin");
153+
var ExternalsPlugin = require("./ExternalsPlugin");
154+
compiler.apply(
155+
new JsonpTemplatePlugin(options.output),
156+
new FunctionModulePlugin(options.output),
157+
new NodeTargetPlugin(),
158+
new ExternalsPlugin("commonjs", [
159+
"app",
160+
"auto-updater",
161+
"browser-window",
162+
"content-tracing",
163+
"dialog",
164+
"global-shortcut",
165+
"ipc",
166+
"menu",
167+
"menu-item",
168+
"power-monitor",
169+
"protocol",
170+
"tray",
171+
"remote",
172+
"web-view",
173+
"clipboard",
174+
"crash-reporter",
175+
"screen",
176+
"shell"
177+
]),
178+
new LoaderTargetPlugin(options.target)
179+
);
180+
break;
149181
default:
150182
throw new Error("Unsupported target '" + options.target + "'.");
151183
}

0 commit comments

Comments
 (0)