Skip to content

Commit d76aab5

Browse files
committed
Use require without the context
1 parent 8ad57a7 commit d76aab5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/react-renderer-demo/src/components/doc-page.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import { makeStyles } from '@material-ui/core/styles';
1010
import ListOfContents from '../helpers/list-of-contents';
1111
import ListOfContentsMobile from '../helpers/list-of-contents-select';
1212

13-
const reqSource = require.context('!raw-loader!@docs/pages', true, /\.md/);
14-
1513
const useStyles = makeStyles((theme) => ({
1614
hidden: {
1715
height: '100%'
@@ -27,7 +25,7 @@ const DocPage = ({ children }) => {
2725
const router = useRouter();
2826
const classes = useStyles();
2927

30-
const text = reqSource(`./${router.pathname.replace('/', '')}.md`).default;
28+
const text = require(`!raw-loader!@docs/pages/${router.pathname.replace('/', '')}.md`).default;
3129

3230
const regex = /^#+ .*/gm;
3331
const found = text.match(regex) || [];

0 commit comments

Comments
 (0)