咕噜构建中止由于预警"目的地不写,因为HTML缩小的是空"和"解析错误:" [英] grunt build Aborted due to warning "Destination not written because minified HTML was empty" and "Parse Error:"
问题描述
我使用的约曼( http://yeoman.io/ ),我通常只运行
咕噜构建
为了来缩小和上传我的AngularJS应用服务器。但是由于某种原因,我得到一个
>>目标不写,因为HTML缩小的是空的。
我以前没有过这样的麻烦到现在为止,我没有改变我的咕噜文件。它好像一切越来越minifies就好了,即使是相同/ views目录中的其他HTML文件。我在此线程读取(<一个href=\"http://stackoverflow.com/questions/24382098/grunt-serve-concurrentserver-aborts-due-to-warnings\">grunt服务:并发:服务器中止由于警告的)的东西与SCSS,但我似乎无法针点的问题。为什么我不能再压缩我的DSIT /视图/ main.html中?下面是它看起来像在终端
运行htmlmin:DIST(htmlmin)任务
精缩DIST / 404.html 3.53 KB→3.39 KB
精缩DIST / index.html的2.5 KB→2.31 KB
精缩DIST /视图/ about.html 31B的→30个B
&GT;&GT;目标不写,因为HTML缩小的是空的。
精缩DIST /视图/ explore.html 33乙→32乙
警告:DIST /视图/ main.html中
解析错误:其中,一NG点击=nextCampaign()下课导航键&GT;
&LT; I类=发FA-字形右FA-2X&GT;&LT; / I&GT;
&所述; / A&GT;
&LT; / NAV&GT; .........更多code
下面是htmlmin:DIST在我的咕噜声文件,该文件是给我的错误
htmlmin:{
距:{
选项:{
collapseWhitespace:真实,
conservativeCollapse:真实,
collapseBooleanAttributes:真实,
removeCommentsFromCDATA:真实,
removeOptionalTags:真
},
文件:[{
拓展:真实,
CWD:'&LT;%= yeoman.dist%GT;,
SRC:'意见/ {* /} * HTML''*。html的'],
DEST:'&LT;%= yeoman.dist%GT;'
}]
}
},
下面是它抱怨
的main.html中成分 解析错误:其中,一NG点击=nextCampaign()下课导航键&GT;
&LT; I类=发FA-字形右FA-2X&GT;&LT; / I&GT;
&所述; / A&GT;
&LT; / NAV&GT; &LT;导航类=modal- previous隐藏移动&GT;
&LT;一个NG点击=previousCampaign()下课导航键&GT;
&LT; I类=发FA-字形左FA-2X&GT;&LT; / I&GT;
&所述; / A&GT;
&LT; / NAV&GT;
想通了。这只是一个简单的错误,我离开了一个=之间
类导航键
我只是把它改成
类=导航键
和一切都很好。如果你得到这个错误,请检查端子告诉你该行有一个
解析错误:... HTML ...
有时候就是这样简单。
I am using Yeoman (http://yeoman.io/) and I usually just run
grunt build
in order to minify and upload my AngularJS app to the server. However for some reason I am getting a
>> Destination not written because minified HTML was empty.
I haven't had this trouble before until now and I have not changed my Grunt file. It seems as though everything else is getting minifies just fine, even the other html files within the same /views directory. I read on this thread (grunt serve: concurrent:server aborts due to warnings) about something with SCSS but I can't seem to pin point the issue. Why can't I minify my dsit/views/main.html? Here is what it looks like in the terminal
Running "htmlmin:dist" (htmlmin) task
Minified dist/404.html 3.53 kB → 3.39 kB
Minified dist/index.html 2.5 kB → 2.31 kB
Minified dist/views/about.html 31 B → 30 B
>> Destination not written because minified HTML was empty.
Minified dist/views/explore.html 33 B → 32 B
Warning: dist/views/main.html
Parse Error: <a ng-click="nextCampaign()" class"nav-button">
<i class="fa fa-chevron-right fa-2x"></i>
</a>
</nav>......... more code
Here is the "htmlmin:dist" in my Grunt file that is giving me the error
htmlmin: {
dist: {
options: {
collapseWhitespace: true,
conservativeCollapse: true,
collapseBooleanAttributes: true,
removeCommentsFromCDATA: true,
removeOptionalTags: true
},
files: [{
expand: true,
cwd: '<%= yeoman.dist %>',
src: ['*.html', 'views/{,*/}*.html'],
dest: '<%= yeoman.dist %>'
}]
}
},
Here is the main.html component it is complaining about
Parse Error: <a ng-click="nextCampaign()" class"nav-button">
<i class="fa fa-chevron-right fa-2x"></i>
</a>
</nav>
<nav class="modal-previous hidden-mobile">
<a ng-click="previousCampaign()"class"nav-button">
<i class="fa fa-chevron-left fa-2x"></i>
</a>
</nav>
Figured it out. It was just a simple error, I left out a "=" in between
class"nav-button"
I simply changed it to
class="nav-button"
and everything was all good. If you ever get this error, check the line that the terminal tells you that there is a
Parse Error: ...html...
Sometimes it is just that simple.
这篇关于咕噜构建中止由于预警&QUOT;目的地不写,因为HTML缩小的是空&QUOT;和&QUOT;解析错误:&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!