ERR1 : Use ‘stats.children: true‘ resp. ‘--stats-children‘ for more details
【代码】ERR1 : Use 'stats.children: true' resp. '--stats-children' for more details。
·
23/04/12学习回顾:
以下报错是因为ejs模板引擎,ejs语法就是<%= %>,并且在注释中也会解析
在cli中运行 npm run serve 遇见的error :
1 ERROR in child compilations (Use ‘stats.children: true’ resp. ‘–stats-children’ for more details)
- 在网上搜索error信息,找到以下文章
https://blog.csdn.net/coralpapy/article/details/119383767 - 文章中提了一句相关error解释
需要特别留意html模板的所在文件的绝对路径,否则会报错找不到
1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
//文件路径错误报错
- 于是定位error应该是由于public里面的index.html 里面
- 通过部分复制粘贴与源码的对比,发现在问题处在注释里面<%= %>,导致模板解析时出问题.
<head>
<!-- 配置页签的图标,当项目实施时可能有各种路径问题,cli因此在这里把./和/转化成<%= %>,底层有一定处理-->
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 配置网页的标题<%= %> 中的内容代表来到package.json中找到name对应的名称=>webpack插件的一个功能 -->
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
- 之后学习中应该注意解释内容
更多推荐
已为社区贡献1条内容
所有评论(0)