Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102503787
ElectronTargetPlugin.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Feb 21, 09:48
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Feb 23, 09:48 (2 d)
Engine
blob
Format
Raw Data
Handle
24329141
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
ElectronTargetPlugin.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict"
;
const
ExternalsPlugin
=
require
(
"../ExternalsPlugin"
);
/** @typedef {import("../Compiler")} Compiler */
class
ElectronTargetPlugin
{
/**
* @param {"main" | "preload" | "renderer"=} context in main, preload or renderer context?
*/
constructor
(
context
)
{
this
.
_context
=
context
;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply
(
compiler
)
{
new
ExternalsPlugin
(
"commonjs"
,
[
"clipboard"
,
"crash-reporter"
,
"electron"
,
"ipc"
,
"native-image"
,
"original-fs"
,
"screen"
,
"shell"
]).
apply
(
compiler
);
switch
(
this
.
_context
)
{
case
"main"
:
new
ExternalsPlugin
(
"commonjs"
,
[
"app"
,
"auto-updater"
,
"browser-window"
,
"content-tracing"
,
"dialog"
,
"global-shortcut"
,
"ipc-main"
,
"menu"
,
"menu-item"
,
"power-monitor"
,
"power-save-blocker"
,
"protocol"
,
"session"
,
"tray"
,
"web-contents"
]).
apply
(
compiler
);
break
;
case
"preload"
:
case
"renderer"
:
new
ExternalsPlugin
(
"commonjs"
,
[
"desktop-capturer"
,
"ipc-renderer"
,
"remote"
,
"web-frame"
]).
apply
(
compiler
);
break
;
}
}
}
module
.
exports
=
ElectronTargetPlugin
;
Event Timeline
Log In to Comment