Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82568634
ContextExclusionPlugin.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
Thu, Sep 12, 04:22
Size
797 B
Mime Type
text/x-c++
Expires
Sat, Sep 14, 04:22 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20715041
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
ContextExclusionPlugin.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict"
;
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./ContextModuleFactory")} ContextModuleFactory */
class
ContextExclusionPlugin
{
/**
* @param {RegExp} negativeMatcher Matcher regular expression
*/
constructor
(
negativeMatcher
)
{
this
.
negativeMatcher
=
negativeMatcher
;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply
(
compiler
)
{
compiler
.
hooks
.
contextModuleFactory
.
tap
(
"ContextExclusionPlugin"
,
cmf
=>
{
cmf
.
hooks
.
contextModuleFiles
.
tap
(
"ContextExclusionPlugin"
,
files
=>
{
return
files
.
filter
(
filePath
=>
!
this
.
negativeMatcher
.
test
(
filePath
));
});
});
}
}
module
.
exports
=
ContextExclusionPlugin
;
Event Timeline
Log In to Comment