-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
36 lines (32 loc) · 836 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* @typedef {import('webpack').Configuration} Configuration
*/
/**
* @typedef {import('webpack').Compiler} Compiler
*/
module.exports =
class OverrideWebpackConfigPlugin {
/**
* @type {(webpackConfig: Configuration) => void}
*/
options;
/**
*
* @param {(webpackConfig: Configuration) => void} options
*/
constructor(options) {
this.options = options;
}
/**
*
* @param {Compiler} compiler
* @returns
*/
apply(compiler) {
if (!this.options) {
console.warn('OverridePCFWebpackPlugin was registered without passing an Override configuration');
return;
}
this.options(compiler.options);
}
}