Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91000028
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
Wed, Nov 6, 19:31
Size
797 B
Mime Type
text/x-c++
Expires
Fri, Nov 8, 19:31 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22174369
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