source: imaps-frontend/node_modules/webpack/lib/electron/ElectronTargetPlugin.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[79a0317]1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5
6"use strict";
7
8const ExternalsPlugin = require("../ExternalsPlugin");
9
10/** @typedef {import("../Compiler")} Compiler */
11
12class ElectronTargetPlugin {
13 /**
14 * @param {"main" | "preload" | "renderer"=} context in main, preload or renderer context?
15 */
16 constructor(context) {
17 this._context = context;
18 }
19
20 /**
21 * Apply the plugin
22 * @param {Compiler} compiler the compiler instance
23 * @returns {void}
24 */
25 apply(compiler) {
26 new ExternalsPlugin("node-commonjs", [
27 "clipboard",
28 "crash-reporter",
29 "electron",
30 "ipc",
31 "native-image",
32 "original-fs",
33 "screen",
34 "shell"
35 ]).apply(compiler);
36 switch (this._context) {
37 case "main":
38 new ExternalsPlugin("node-commonjs", [
39 "app",
40 "auto-updater",
41 "browser-window",
42 "content-tracing",
43 "dialog",
44 "global-shortcut",
45 "ipc-main",
46 "menu",
47 "menu-item",
48 "power-monitor",
49 "power-save-blocker",
50 "protocol",
51 "session",
52 "tray",
53 "web-contents"
54 ]).apply(compiler);
55 break;
56 case "preload":
57 case "renderer":
58 new ExternalsPlugin("node-commonjs", [
59 "desktop-capturer",
60 "ipc-renderer",
61 "remote",
62 "web-frame"
63 ]).apply(compiler);
64 break;
65 }
66 }
67}
68
69module.exports = ElectronTargetPlugin;
Note: See TracBrowser for help on using the repository browser.