12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- "use strict";
- const WebpackError = require("./WebpackError");
- class WarnDeprecatedOptionPlugin {
-
- constructor(option, value, suggestion) {
- this.option = option;
- this.value = value;
- this.suggestion = suggestion;
- }
-
- apply(compiler) {
- compiler.hooks.thisCompilation.tap(
- "WarnDeprecatedOptionPlugin",
- compilation => {
- compilation.warnings.push(
- new DeprecatedOptionWarning(this.option, this.value, this.suggestion)
- );
- }
- );
- }
- }
- class DeprecatedOptionWarning extends WebpackError {
-
- constructor(option, value, suggestion) {
- super();
- this.name = "DeprecatedOptionWarning";
- this.message =
- "configuration\n" +
- `The value '${value}' for option '${option}' is deprecated. ` +
- `Use '${suggestion}' instead.`;
- }
- }
- module.exports = WarnDeprecatedOptionPlugin;
|