Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F77955589
ExternalsPlugin.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
Sat, Aug 17, 11:20
Size
899 B
Mime Type
text/x-c++
Expires
Mon, Aug 19, 11:20 (2 d)
Engine
blob
Format
Raw Data
Handle
19952972
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
ExternalsPlugin.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict"
;
const
ExternalModuleFactoryPlugin
=
require
(
"./ExternalModuleFactoryPlugin"
);
/** @typedef {import("../declarations/WebpackOptions").Externals} Externals */
/** @typedef {import("./Compiler")} Compiler */
class
ExternalsPlugin
{
/**
* @param {string | undefined} type default external type
* @param {Externals} externals externals config
*/
constructor
(
type
,
externals
)
{
this
.
type
=
type
;
this
.
externals
=
externals
;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply
(
compiler
)
{
compiler
.
hooks
.
compile
.
tap
(
"ExternalsPlugin"
,
({
normalModuleFactory
})
=>
{
new
ExternalModuleFactoryPlugin
(
this
.
type
,
this
.
externals
).
apply
(
normalModuleFactory
);
});
}
}
module
.
exports
=
ExternalsPlugin
;
Event Timeline
Log In to Comment