webpack4使用出现ERROR in Template execution failed: ReferenceError: HtmlwebpackPlugin is not defined
问题描述
博主在使用webpack4的时候,使用了ejs文件,先附上ejs中的代码:
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>webpack APP</title>
<link rel="stylesheet" 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打包编译命令时却出现了下面的错误:

解决办法
通过查找资料,发现是webpack3中的htmlwebpackPlugin使用webpack4时需要写成htmlWebpackPlugin,这样就能解决问题。
webpack4使用出现ERROR in Template execution failed: ReferenceError: HtmlwebpackPlugin is not defined的更多相关文章
- ERROR in Template execution failed: ReferenceError: htmlwebpackPlugin is not defined
ejs文件配置如下: <!DOCTYPE html> <html lang="zh-CN"> <head> <title>webpa ...
- Error:Execution failed for task ':app:clean'.
运行时出现 Error:Execution failed for task ':app:clean'. 错误,Builld->Clean Project即可.
- Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
使用android studio 时,编译成功但用build apk时却报错 环境: android studio 1.5, jdk1.7 错误:Error:Execution failed for ...
- Android Studio 运行出现 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
转载请标明出处: http://www.cnblogs.com/why168888/p/5978381.html 本文出自:[Edwin博客园] 我引用compile 'com.squareup.re ...
- Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决记录
转载请标明出处: http://blog.csdn.net/lxk_1993/article/details/50511172 本文出自:[lxk_1993的博客]: 3个错误non-zero e ...
- Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs f
今天调试安卓程序遇到的问题Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching fa ...
- 异常问题解决Error:Execution failed for task ':app:processDebugManifest'
Error:Execution failed for task ':app:processDebugManifest' www.MyException.Cn 网友分享于:2015-12-28 浏览 ...
- BUG Error:Execution failed for task ':app:dexDebug'.
Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessExceptio ...
- Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException
异常Log: Error:Execution failed for task ‘:app:dexDebug’. > com.android.ide.common.process.ProcessE ...
随机推荐
- stand up meeting 12-4
今日进步: 1.国庆答题界面和结果界面的连接完成,并能显示GetRankData API返回结果和错误题目的单词信息. 2.天赋: 完成了整个 单词挑战需要碰到的"Storage" ...
- F. Count Prime Pairs
单点时限: 2.0 sec 内存限制: 512 MB 对于数组a,如果i≠j并且ai+aj是一个质数,那么我们就称(i,j)为质数对,计算数组中质数对的个数. 输入格式 第一行输入一个n,表示数组的长 ...
- Zipper 杭电 1501
Given three strings, you are to determine whether the third string can be formed by combining the ch ...
- python selenium模块 xpath定位
''' 附w3xpath语法地址 https://www.w3school.com.cn/xpath/xpath_syntax.asp 总结: 返回匹配到所有符合条件的第一个节点,对象是 <cl ...
- Laravel 分页 数据丢失问题解决
问题: to do list 中有32条数据,每页10条,共3页. 做完了一个事项之后,准备打卡,发现找不到这个事项. 数据库查询正常,有这一条数据. 原因: 发现是分页出了问题,第1页的数据和第2页 ...
- CAS原理解析
CAS底层原理 概念 CAS的全称是Compare-And-Swap,它是CPU并发原语 它的功能是判断内存某个位置的值是否为预期值,如果是则更改为新的值,这个过程是原子的 CAS并发原语体现在Jav ...
- tensorflow1.0 dropout层
""" Please note, this code is only for python 3+. If you are using python 2+, please ...
- 微信jssdk遇到的一些问题汇总
1.用户手动去触发的接口可以直接调用比如wx.startRecord(); 但是写在页面加载完成里就无效,需要写在 wx.ready(function(){ wx.startRecord(); }); ...
- 虚拟化KVM之概述(一)
云计算基本概述 云计算是一种按使用量付费的模式,这种模式提供可用的.便捷的.按需的网络访问,进入可配置的计算资源共享池(资源包括网络,服务器,存储,应用程序,服务),这些资源能够被快速提供,只需投入很 ...
- 日志分析工具ELK(二)
五.Logstash日志收集实践 在学习Logstash之前,我们需要先了解以下几个基本概念: logstash收集日志基本流程: input-->codec-->filter--> ...