commercetools / commercetools-docs-kit

Tools and components for developing Documentation websites 🛠
https://docs-kit.commercetools.vercel.app
MIT License
18 stars 5 forks source link

Investigate why imports in mdx are not working #104

Closed emmenko closed 4 years ago

emmenko commented 4 years ago

MDX supports importing mdx and react components as react components:

https://mdxjs.com/getting-started#documents

Somehow it currently does not work in our setup.

Ref: #85

emmenko commented 4 years ago

I can confirm that this works out of the box. Example set up:

src/
  content/
    test.mdx
  topics/
    hello.mdx

In test.mdx, simply import

---
title: Test
---

This is a test page

import Hello from '../topics/hello'

<Hello />

Something else.

In hello.mdx

Hello, world!

The output is:

image