From f9a09072e35e274cf4c13b67d228ece3b7722d47 Mon Sep 17 00:00:00 2001 From: Amy Lam Date: Thu, 17 May 2018 16:17:56 -0700 Subject: [PATCH] Add LiveReload (#663) --- admin/testing-changes-on-Docusaurus-itself.md | 2 +- lib/core/Site.js | 11 +- lib/core/constants.js | 10 ++ lib/server/server.js | 31 +++++ lib/start-server.js | 2 +- package-lock.json | 129 ++++++++++++++++++ package.json | 4 +- yarn.lock | 99 +++++++++++++- 8 files changed, 279 insertions(+), 9 deletions(-) create mode 100644 lib/core/constants.js diff --git a/admin/testing-changes-on-Docusaurus-itself.md b/admin/testing-changes-on-Docusaurus-itself.md index 2abab9661efc..3ec45b4102b3 100644 --- a/admin/testing-changes-on-Docusaurus-itself.md +++ b/admin/testing-changes-on-Docusaurus-itself.md @@ -47,4 +47,4 @@ Feel free to contribute debug instructions for other IDEs ### Observing changes -Now that the server is running, you can make changes to the core Docusaurus code and docs to see the effects on the Docusaurus site. Just refresh the local site, usually running at http://localhost:3000 +Now that the server is running, you can make changes to the core Docusaurus code and docs to see the effects on the Docusaurus site. LiveReload will reflect changes to the local site in your browser, usually running at http://localhost:3000 diff --git a/lib/core/Site.js b/lib/core/Site.js index 9c151f4f0905..ab68638cf8e7 100644 --- a/lib/core/Site.js +++ b/lib/core/Site.js @@ -7,11 +7,13 @@ const React = require('react'); const fs = require('fs'); +const classNames = require('classnames'); + const HeaderNav = require('./nav/HeaderNav.js'); const Head = require('./Head.js'); const Footer = require(process.cwd() + '/core/Footer.js'); const translation = require('../server/translation.js'); -const classNames = require('classnames'); +const constants = require('./constants'); const CWD = process.cwd(); @@ -159,6 +161,13 @@ class Site extends React.Component { }} /> ))} + {process.env.NODE_ENV === 'development' && ( +