Yeoman grunt-usemin生成空的html

时间:2014-08-06 08:51:56

标签: gruntjs yeoman grunt-usemin

我遇到grunt-usemin的问题,它可以正常使用build:js标记,但是当它到达build:css标记时会删除该文件中的所有内容。

我使用官方的Yeoman生成器设置了网络应用程序:yo webapp,然后对我的项目进行了一些调整。文件夹树如下:

/
- app
  |- bower_components
  |- content
  |- fonts
  |- images
  |- includes
  |- scripts
  |- styles
     index.php
     ...
- dist
...

除了包含.php部分的contentincludes

之外没什么好看的

正确生成了一个文件app/includes/html-scripts.php,其中包含以下标记:

<!-- build:js(app) scripts/vendor/frameworks.js -->
<!-- bower:js -->
<script src="../bower_components/jquery/dist/jquery.js"></script>
<!-- endbower -->
<!-- endbuild -->
...
<!-- build:js({app,.tmp}) scripts/main.js -->
<script src="scripts/scripts.js"></script>
<!-- endbuild -->

但是app/includes/html-head.phpusemin的最后一步(grunt build)中被清空了。它包含:

<!-- build:css(.tmp) styles/main.css -->
<link rel="stylesheet" href="styles/fonts.css">
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->
...

我也尝试使用build:css({.tmp,app})build:css,同样。

这是我的Gruntfile.jshttp://pastebin.com/9ZpjkGjY(我尝试使用sass:dist代替compass:dist,结果相同)

以下是我的package.jsonhttp://pastebin.com/VAPwm71f

任何人都可以帮忙解答一下吗?

0 个答案:

没有答案