mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 13:06:58 +02:00
Add LiveReload (#663)
This commit is contained in:
parent
fed67dcee4
commit
f9a09072e3
8 changed files with 279 additions and 9 deletions
|
@ -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' && (
|
||||
<script
|
||||
src={`http://localhost:${
|
||||
constants.LIVE_RELOAD_PORT
|
||||
}/livereload.js`}
|
||||
/>
|
||||
)}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
|
10
lib/core/constants.js
Normal file
10
lib/core/constants.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
LIVE_RELOAD_PORT: 35729,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue