chore(types): add type support for WarnNoModeSetPlugin and Warning
This commit is contained in:
parent
7dc00dbc09
commit
94499787f8
|
@ -6,7 +6,13 @@
|
||||||
|
|
||||||
const WebpackError = require("./WebpackError");
|
const WebpackError = require("./WebpackError");
|
||||||
|
|
||||||
module.exports = class NoModeWarning extends WebpackError {
|
/** @typedef {import("./Module")} Module */
|
||||||
|
|
||||||
|
class NoModeWarning extends WebpackError {
|
||||||
|
/**
|
||||||
|
* @param {Module[]=} modules modules used
|
||||||
|
*/
|
||||||
|
// TODO: Do we need this modules argument from constructor if its not used?
|
||||||
constructor(modules) {
|
constructor(modules) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
@ -20,4 +26,6 @@ module.exports = class NoModeWarning extends WebpackError {
|
||||||
|
|
||||||
Error.captureStackTrace(this, this.constructor);
|
Error.captureStackTrace(this, this.constructor);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
module.exports = NoModeWarning;
|
||||||
|
|
|
@ -6,7 +6,13 @@
|
||||||
|
|
||||||
const NoModeWarning = require("./NoModeWarning");
|
const NoModeWarning = require("./NoModeWarning");
|
||||||
|
|
||||||
|
/** @typedef {import("./Compiler")} Compiler */
|
||||||
|
|
||||||
class WarnNoModeSetPlugin {
|
class WarnNoModeSetPlugin {
|
||||||
|
/**
|
||||||
|
* @param {Compiler} compiler webpack compiler instance
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
apply(compiler) {
|
apply(compiler) {
|
||||||
compiler.hooks.thisCompilation.tap("WarnNoModeSetPlugin", compilation => {
|
compiler.hooks.thisCompilation.tap("WarnNoModeSetPlugin", compilation => {
|
||||||
compilation.warnings.push(new NoModeWarning());
|
compilation.warnings.push(new NoModeWarning());
|
||||||
|
|
Loading…
Reference in New Issue