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

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 id="app"></div>
    <script type="text/javascript" src="<%= htmlwebpackPlugin.files.js[0] %>"></script>
</body>
</html>

运行:

npm run build

报错如下:

 

 解决方法:

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

posted @ 2019-11-21 16:16  用脑袋行走的人  阅读(4968)  评论(0编辑  收藏  举报