webpack/lib/MovedToPluginWarningPlugin.js

20 lines
760 B
JavaScript
Raw Normal View History

/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
function MovedToPluginWarningPlugin(optionName, pluginName) {
this.optionName = optionName;
2015-04-24 05:55:50 +08:00
this.pluginName = pluginName;
}
module.exports = MovedToPluginWarningPlugin;
MovedToPluginWarningPlugin.prototype.apply = function(compiler) {
var optionName = this.optionName;
2015-04-24 05:55:50 +08:00
var pluginName = this.pluginName;
compiler.plugin("compilation", function(compilation) {
2016-09-07 20:57:53 +08:00
compilation.warnings.push(new Error("webpack options:\nDEPRECATED option '" + optionName + "' will be moved to the " + pluginName + ". " +
"Use this instead.\n" +
"For more info about the usage of the " + pluginName + " see https://webpack.github.io/docs/list-of-plugins.html"));
});
};