UNPKG

545 BJavaScriptView Raw
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5
6"use strict";
7
8const NoModeWarning = require("./NoModeWarning");
9
10/** @typedef {import("./Compiler")} Compiler */
11
12class WarnNoModeSetPlugin {
13 /**
14 * Apply the plugin
15 * @param {Compiler} compiler the compiler instance
16 * @returns {void}
17 */
18 apply(compiler) {
19 compiler.hooks.thisCompilation.tap("WarnNoModeSetPlugin", compilation => {
20 compilation.warnings.push(new NoModeWarning());
21 });
22 }
23}
24
25module.exports = WarnNoModeSetPlugin;