-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: reload siteConfig.js automatically when locally served page is refreshed #1509
Conversation
Deploy preview for docusaurus-2 ready! Built with commit ef84f36 |
Deploy preview for docusaurus-preview ready! Built with commit 535fe04 |
1 similar comment
Deploy preview for docusaurus-preview ready! Built with commit 535fe04 |
@@ -15,7 +15,8 @@ module.exports = { | |||
testPathIgnorePatterns: [ | |||
'/node_modules/', | |||
'__fixtures__', | |||
'/packages/.*/lib', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise it is ignoring the tests on v1. My bad !!
Deploy preview for docusaurus-preview ready! Built with commit 6d7818c |
const React = require('react'); | ||
const path = require('path'); | ||
const fs = require('fs-extra'); | ||
const metadataUtils = require('./metadataUtils'); | ||
const {replaceAssetsLink} = require('./utils.js'); | ||
const {renderToStaticMarkupWithDoctype} = require('./renderUtils'); | ||
const loadConfig = require('./config'); | ||
|
||
const siteConfig = loadConfig(`${CWD}/siteConfig.js`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
less CWD calls >.<
|
||
const siteConfig = loadConfig(`${CWD}/siteConfig.js`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more cwd calls
Deploy preview for docusaurus-preview ready! Built with commit ef84f36 |
Motivation
An attempt to reduce number of siteconfig require calls on Docusaurus 1. In effect, this made siteConfig.js become reloaded automatically. (Finally we can live reload siteconfig)
Others:
This should Fix #267 #1508
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
See the gif below, we can reload siteconfig now for pages, docs and blog