html-webpack-plugin打包报错
Posted 夏小夏
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html-webpack-plugin打包报错相关的知识,希望对你有一定的参考价值。
打包报错
TypeError: Cannot read property \'tap\' of undefined
at htmlWebpackPlugin.apply (D:\\MyData\\xiamy9\\study\\webpack-study\\node_modules\\html-webpack-plugin\\index.js:40:31)
at WebpackCLI.webpack (D:\\MyData\\xiamy9\\study\\webpack-study\\node_modules\\webpack\\lib\\webpack.js:51:13)
at WebpackCLI.createCompiler (D:\\MyData\\xiamy9\\study\\webpack-study\\node_modules\\webpack-cli\\lib\\webpack-cli.js:1845:29)
at async WebpackCLI.buildCommand (D:\\MyData\\xiamy9\\study\\webpack-study\\node_modules\\webpack-cli\\lib\\webpack-cli.js:1952:20)
at async Command.<anonymous> (D:\\MyData\\xiamy9\\study\\webpack-study\\node_modules\\webpack-cli\\lib\\webpack-cli.js:742:25)
at async Promise.all (index 1)
at async Command.<anonymous> (D:\\MyData\\xiamy9\\study\\webpack-study\\node_modules\\webpack-cli\\lib\\webpack-cli.js:1289:13)
发现是版本问题:webpack4 和 html-webpack-plugin5配合使用了,需要将webpack升级或者html-webpack-plugin降级 。
以上是关于html-webpack-plugin打包报错的主要内容,如果未能解决你的问题,请参考以下文章