webpack/lib/WarnNoModeSetPlugin.js

28 lines
581 B
JavaScript
Raw Normal View History

/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
2018-07-30 23:08:51 +08:00
"use strict";
const NoModeWarning = require("./NoModeWarning");
2018-11-03 04:05:46 +08:00
/** @typedef {import("./Compiler")} Compiler */
2025-04-23 20:03:37 +08:00
const PLUGIN_NAME = "WarnNoModeSetPlugin";
class WarnNoModeSetPlugin {
2018-11-03 04:05:46 +08:00
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
compilation.warnings.push(new NoModeWarning());
});
}
}
module.exports = WarnNoModeSetPlugin;