2013-12-18 06:21:49 +08:00
|
|
|
/*
|
|
|
|
|
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;
|
2013-12-18 06:21:49 +08:00
|
|
|
}
|
|
|
|
|
module.exports = MovedToPluginWarningPlugin;
|
|
|
|
|
|
|
|
|
|
MovedToPluginWarningPlugin.prototype.apply = function(compiler) {
|
|
|
|
|
var optionName = this.optionName;
|
2015-04-24 05:55:50 +08:00
|
|
|
var pluginName = this.pluginName;
|
2013-12-18 06:21:49 +08:00
|
|
|
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"));
|
2013-12-18 06:21:49 +08:00
|
|
|
});
|
|
|
|
|
};
|