Skip to content

Commit f870006

Browse files
committed
electron-main and electron-renderer targets
1 parent 3c7b13f commit f870006

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
@@ -112,6 +112,7 @@ WebpackOptionsApply.prototype.process = function(options, compiler) {
112112
break;
113113
case "atom":
114114
case "electron":
115+
case "electron-main":
115116
var NodeTemplatePlugin = require("./node/NodeTemplatePlugin");
116117
var NodeTargetPlugin = require("./node/NodeTargetPlugin");
117118
var ExternalsPlugin = require("./ExternalsPlugin");
@@ -143,6 +144,37 @@ WebpackOptionsApply.prototype.process = function(options, compiler) {
143144
new LoaderTargetPlugin(options.target)
144145
);
145146
break;
147+
case "electron-renderer":
148+
var JsonpTemplatePlugin = require("./JsonpTemplatePlugin");
149+
var NodeTargetPlugin = require("./node/NodeTargetPlugin");
150+
var ExternalsPlugin = require("./ExternalsPlugin");
151+
compiler.apply(
152+
new JsonpTemplatePlugin(options.output),
153+
new FunctionModulePlugin(options.output),
154+
new NodeTargetPlugin(),
155+
new ExternalsPlugin("commonjs", [
156+
"app",
157+
"auto-updater",
158+
"browser-window",
159+
"content-tracing",
160+
"dialog",
161+
"global-shortcut",
162+
"ipc",
163+
"menu",
164+
"menu-item",
165+
"power-monitor",
166+
"protocol",
167+
"tray",
168+
"remote",
169+
"web-view",
170+
"clipboard",
171+
"crash-reporter",
172+
"screen",
173+
"shell"
174+
]),
175+
new LoaderTargetPlugin(options.target)
176+
);
177+
break;
146178
default:
147179
throw new Error("Unsupported target '" + options.target + "'.");
148180
}

0 commit comments

Comments
 (0)