mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 08:19:07 +02:00
fix(v2): fix hot reload sometimes not working due to altered modules (#1370)
This commit is contained in:
parent
1ce4195f14
commit
b4daac96c8
1 changed files with 2 additions and 3 deletions
|
@ -13,7 +13,6 @@ import registry from '@generated/registry';
|
|||
|
||||
function ComponentCreator(path) {
|
||||
const modules = routesAsyncModules[path];
|
||||
const originalModules = modules;
|
||||
const optsModules = [];
|
||||
const optsWebpack = [];
|
||||
const mappedModules = {};
|
||||
|
@ -63,8 +62,8 @@ function ComponentCreator(path) {
|
|||
modules: optsModules,
|
||||
webpack: () => optsWebpack,
|
||||
render: (loaded, props) => {
|
||||
// Transform back loaded modules back into the original structure.
|
||||
const loadedModules = originalModules;
|
||||
// clone the original object since we don't want to alter the original.
|
||||
const loadedModules = JSON.parse(JSON.stringify(modules));
|
||||
Object.keys(loaded).forEach(key => {
|
||||
let val = loadedModules;
|
||||
const keyPath = key.split('.');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue