webpack导致的警告问题

424 阅读1分钟
原文链接: blog.csdn.net

问题

在执行webpack构建过程中,出现 DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead emit告警问题。

在这里插入图片描述

分析原因

这是因为使用的webpack插件中,使用了旧的API导致的。

在这里插入图片描述

而官方文档最新提供的API如下:

官方文档

参考源码
在这里插入图片描述