ejs文件配置如下:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>webpack App</title>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="<%= htmlwebpackPlugin.files.css[0] %>">
</head>
<body>
    <div ></div>
    <script type="text/javascript" src="<%= htmlwebpackPlugin.files.js[0] %>"></script>
</body>
</html>

运行:

npm run build

报错如下:

ERROR in Template execution failed: ReferenceError: htmlwebpackPlugin is not defined

 

 解决方法:

ejs文件配置中得htmlwebpackPlugin修改为htmlWebpackPlugin

相关文章:

  • 2021-09-27
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-10-04
  • 2021-08-06
  • 2021-04-21
相关资源
相似解决方案