mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-14 17:47:40 +02:00
fix(v2): prioritize node_modules resolve (#1057)
This commit is contained in:
parent
5d60739f7c
commit
d8e5f315f1
2 changed files with 5 additions and 8 deletions
|
@ -43,13 +43,10 @@ module.exports = function createBaseConfig(props, isServer) {
|
||||||
.set('@build', outDir)
|
.set('@build', outDir)
|
||||||
.set('@generated', path.resolve(__dirname, '../core/generated'))
|
.set('@generated', path.resolve(__dirname, '../core/generated'))
|
||||||
.set('@core', path.resolve(__dirname, '../core'))
|
.set('@core', path.resolve(__dirname, '../core'))
|
||||||
// For loading docs from custom paths where React is not available.
|
.end()
|
||||||
// TODO(yangshun): Change loader to convert return HTML instead of React component.
|
.modules // prioritize our own node modules
|
||||||
.set(
|
.add(path.resolve(__dirname, '../../node_modules'))
|
||||||
'DOCUSAURUS_NODE_MODULES_PATH_DO_NOT_USE_OR_YOU_WILL_BE_FIRED',
|
.add('node_modules');
|
||||||
path.resolve(__dirname, '../../node_modules/'),
|
|
||||||
)
|
|
||||||
.end();
|
|
||||||
|
|
||||||
function applyBabel(rule) {
|
function applyBabel(rule) {
|
||||||
rule
|
rule
|
||||||
|
|
|
@ -66,7 +66,7 @@ module.exports = function(fileString) {
|
||||||
|
|
||||||
/* Return a React component */
|
/* Return a React component */
|
||||||
return `
|
return `
|
||||||
import React from 'DOCUSAURUS_NODE_MODULES_PATH_DO_NOT_USE_OR_YOU_WILL_BE_FIRED/react';
|
import React from 'react';
|
||||||
import Markdown from '@theme/Markdown';
|
import Markdown from '@theme/Markdown';
|
||||||
export default () => (
|
export default () => (
|
||||||
<Markdown siteConfig={${JSON.stringify(siteConfig)}}>
|
<Markdown siteConfig={${JSON.stringify(siteConfig)}}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue