我刚刚构建了 Nodejs 并安装了 0.10.6,然后卸载了 yo+grunt-cli+bower+generator-webapp 并使用 npm -g 重新安装到最新版本,
哟网络应用
但现在实时重新加载不起作用,在 chrome devtools 中也看不到任何错误
哟-v:1.0beta5
grunt-cli v0.1.8 和 grunt v0.4.1
鲍尔-v:0.9.2
节点-v:0.10.6
npm -v:1.2.18
grunt 服务器显示监视任务:时间+文件名已更改
尝试:将 Gruntfile 中的端口号更改为.. LIVERELOAD_PORT = 34729;不:(
我的旧 webapp 项目仍然工作正常
迷失了..
谢谢
--------------------- 更新
1. 将 lrSnippet 移至 Grunfile.js 中的第 1 个位置
2.在index.js中移动
end.call(res, res.data, encoding);
在 if block 之外
现在可以部分使用了:
摘要:
1. 更改index.html > 重新加载即可
2. 更改 main.scss > 重新加载即可
3. 更改 my.sass > 不正常
第三步之后
1. 更改index.html > 不行
2. 更改 main.scss > 不正常
4. 更改 hello.coffe > 不正常
第 4 步之后
1. 修改index.html > ok
2.更改main.scss > ok
//-------------------------------------index.html
对index.html的更改
重新加载即可
grunt 服务器窗口记录更改并发出重新加载命令
grunt 服务器窗口抓取=
Running "watch" task
Waiting...OK
>> File "app/index.html" changed.
Running "watch" task
... Reload app/index.html ...
Completed in 0.002s at Sat May 18 2013 12:47:58 GMT+0530 (IST) - Waiting...
//------------------------------------- main.scss
对 main.scss 的更改
重新加载即可
grunt 服务器窗口抓取 =
>> File "app/styles/main.scss" changed.
Running "compass:server" (compass) task
overwrite .tmp/styles/main.css
unchanged app/styles/my.sass
Running "watch" task
Completed in 1.906s at Sat May 18 2013 12:48:24 GMT+0530 (IST) - Waiting...
OK
>> File ".tmp/styles/main.css" changed.
Running "watch" task
... Reload .tmp/styles/main.css ...
Completed in 0.002s at Sat May 18 2013 12:48:24 GMT+0530 (IST) - Waiting...
//------------------------------------- my.sass
对 my.sass 的更改
重新加载不行(不重新加载)
grunt 服务器窗口抓取 =
Running "watch" task
Waiting...OK
>> File "app/styles/my.sass" changed.
Running "compass:server" (compass) task
unchanged app/styles/main.scss
unchanged .tmp/images/generated/design-s65ab268e46.png
overwrite .tmp/styles/my.css
Running "watch" task
Completed in 0.602s at Sat May 18 2013 13:00:19 GMT+0530 (IST) - Waiting...
//--------------------------------------
my.sass 更改后
对 index.html 或 main.scss 所做的更改未显示在 grunt 服务器窗口中
Watch 命令不记录任何内容。
更改 r 未重新加载
//------------------------------------------------
重新启动 Grunt 服务器
//------------------------------------------------- hello.coffee
grunt 服务器窗口抓取=
OK
>> File "app/scripts/hello.coffee" changed.
Running "coffee:dist" (coffee) task
File .tmp/scripts/hello.js created.
Running "watch" task
Completed in 0.011s at Sat May 18 2013 13:34:56 GMT+0530 (IST) - Waiting...
//------------------------------------------------
最佳答案
当前的 livereload/yo 设置存在错误。以下是详细信息以及有问题的依赖项的修复(connect-livereload)。
关于yeoman - 升级 yo grunt-cli Bower 后实时重新加载不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16567460/