gatsby new tutorial-part-one https://github.com/gatsbyjs/gatsby-starter-hello-world
cd tutorial-part-one && gatsby develop
index.js
in src/pages/
and save the file.编辑index.js
中的src/pages/
并保存文件。Gatsby's development server should hot reload in the browser and reflect changes made in src/pages/index.js
. Gatsby 的开发服务器应该在浏览器中热重载并反映在src/pages/index.js
中所做的更改。 The view must be as below:视图必须如下:
No hot reloading in the browser.浏览器中没有热重载。
It works for me when I start the server with gatsby develop --host localhost
.当我使用gatsby develop --host localhost
启动服务器时,它对我有用。 This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop
.这要么是意外行为,要么应该添加到所有提到使用gatsby develop
进行热重载的教程中。
@andreasgruenh添加gatsby develop --host localhost
不会将开发服务器暴露给网络。
Hi @andreasgruenh @gagan0723 please see https://github.com/gatsbyjs/gatsby/pull/2983#issuecomment -346126702 and https://github.com/gatsbyjs/gatsby/issues/2960#issuecomment -346130796 and more recent comments.嗨@andreasgruenh @gagan0723请参阅https://github.com/gatsbyjs/gatsby/pull/2983#issuecomment -346126702 和https://github.com/gatsbyjs/gatsby/issues/2960#issuecomment -346130796 和更多最新评论. Looks like we should default to localhost
on Mac as well to avoid these.看起来我们应该在 Mac 上默认为localhost
以避免这些。 For local network testing on Mac can do -H [machine_name].local
, any of that help?对于 Mac 上的本地网络测试可以做-H [machine_name].local
,有什么帮助吗?
最有用的评论
It works for me when I start the server with
engatsby develop --host localhost
.当我使用gatsby develop --host localhost
启动服务器时,它对我有用。 This is either unexpected behavior or should be added to all tutorials that mention hot reloading withgatsby develop
.这要么是意外行为,要么应该添加到所有提到使用gatsby develop
进行热重载的教程中。