我是一个grunt新手,我的电脑运行的是Windows 7 x64。
我按照Yeoman网站上的教程操作,并且没有更改任何生成文件中的内容。然后,我运行了以下命令:
grunt serve
当我修改任何html文件时,grunt的处理过程是瞬间完成的,但是当我修改其中一个.js或.css文件时,这个过程变得异常缓慢。当我保存时,grunt立即注意到了:
>> File "app\styles\index.css" changed
但似乎在下一行出现在终端之前,大约需要4秒钟的时间:
Running "newer:copy:styles" (newer) task
Running "copy:styles" (copy) task
Copied 1 files
Running "newer-timestamp:copy:styles:R:\Personnel\Workspaces\web\front\plume\node_modules\grunt-newer\.cache" (newer-timestamp)
task
Running "newer-reconfigure:copy:styles:1" (newer-reconfigure) task
Running "autoprefixer:dist" (autoprefixer) task
Prefixed file ".tmp/styles/index.css" created.
Prefixed file ".tmp/styles/main.css" created.
Done, without errors.
Execution Time (2014-03-21 00:00:19 UTC)
loading tasks 6ms ■■■■■ 9%
newer:copy:styles 9ms ■■■■■■■■ 14%
copy:styles 7ms ■■■■■■ 11%
newer-timestamp:copy:style...odules\grunt-newer\.cache 3ms ■■■ 5%
autoprefixer 1ms ■ 2%
autoprefixer:dist 39ms ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 59%
Total 66ms
... Reload .tmp\styles\index.css ...
... Reload .tmp\styles\main.css ...
Completed in 4.463s at Fri Mar 21 2014 01:00:20 GMT+0100 (Paris, Madrid) -
等待中...
我有些困惑。grunt说它总共花费了66ms来运行任务,但是它又说它花费了4.463秒来完成整个过程。
我做错了什么吗?构建很干净,我除了这个什么都没做。
yo angular
如何搭建应用程序?有任何想法吗?
编辑:
spawn: false
解决了我的问题。感谢提出这个想法的人。即使我现在使用Gulp或webpack。