问题描述

博主在使用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的更多相关文章

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

    ejs文件配置如下: <!DOCTYPE html> <html lang="zh-CN"> <head> <title>webpa ...

  2. Error:Execution failed for task ':app:clean'.

    运行时出现 Error:Execution failed for task ':app:clean'. 错误,Builld->Clean Project即可.

  3. Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

    使用android studio 时,编译成功但用build apk时却报错 环境: android studio 1.5, jdk1.7 错误:Error:Execution failed for ...

  4. Android Studio 运行出现 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

    转载请标明出处: http://www.cnblogs.com/why168888/p/5978381.html 本文出自:[Edwin博客园] 我引用compile 'com.squareup.re ...

  5. Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决记录

    转载请标明出处: http://blog.csdn.net/lxk_1993/article/details/50511172 本文出自:[lxk_1993的博客]:   3个错误non-zero e ...

  6. 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 ...

  7. 异常问题解决Error:Execution failed for task ':app:processDebugManifest'

    Error:Execution failed for task ':app:processDebugManifest' www.MyException.Cn  网友分享于:2015-12-28  浏览 ...

  8. BUG Error:Execution failed for task ':app:dexDebug'.

    Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessExceptio ...

  9. 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 ...

随机推荐

  1. 统计子串数量,Python基础

    前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者:陈YL PS:如有需要Python学习资料的小伙伴可以加点击下方链接自 ...

  2. 远程登录redis

    没想到吧,我居然已经摸到了redis. 远程登录redis redis-cli -h 127.0.0.1 -p 6379 ip地址和端口记得换成自己的

  3. vue2.x学习笔记(九)

    接着前面的内容:https://www.cnblogs.com/yanggb/p/12577948.html. 数组的更新检测 数组在javascript是一种特殊的对象,不是像普通的对象那样通过Ob ...

  4. C#开发BIMFACE系列33 服务端API之模型对比4:获取模型对比结果

    系列目录     [已更新最新开发文章,点击查看详细] 模型对比可以对两个文件/模型进行差异性分析,确定两个文件/模型之间构件的几何和属性差异,包括增加的构件.删除的构件和修改的构件. 模型对应可以用 ...

  5. python之pymysql库连接mysql实现增、删、改、查

    安装第三方库pymysql 命令行cmd下通过pip install pymysql进行安装,安装完成后自行pip list可查看对应的版本信息 建立连接 1 #导入pymysql库 2 import ...

  6. (一)微信小程序:实现引导页

    基本目录结构 index目录下文件操作步骤 1.针对index.wxml <!--index.wxml--> <view class="index-container&qu ...

  7. Java中什么是构造方法

    this(...)本类的构造方法super(...)父类的构造方法构造方法:给对象的数据进行初始化格式:A:方法名与类名相同B:没有返回值类型,连void都没有C:没有具体的返回值注意事项:A:如果我 ...

  8. 0day学习笔记(2)--函数调用

    函数调用过程 调用函数操作 函数参数入栈(在当前函数栈帧),从左至右或从右至左视情况而定 一般为从右至左 mov 地址,参数 的一个操作并不直接pop而是定位到地址将参数传递进去 call offse ...

  9. tp5--Excel表格导入导出

    来源于:https://www.cnblogs.com/MyIsLu/p/6830579.html PHPExcel 扩展包下载地址:             https://github.com/P ...

  10. Decision tree——决策树

    基本流程 决策树是通过分次判断样本属性来进行划分样本类别的机器学习模型.每个树的结点选择一个最优属性来进行样本的分流,最终将样本类别划分出来. 决策树的关键就是分流时最优属性$a$的选择.使用所谓信息 ...