facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
55.87k stars 8.37k forks source link

custom import of md file into the react component files #10221

Closed nage1234 closed 3 months ago

nage1234 commented 3 months ago

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

Hey Team, Good Day! I am using Docusaurus for our company doc site. We are facing issue in importing of md files into our react component. Will give u a little context on this. We have say 100s of md files in our docs folder, but, we wanted to show on click of user choosing an item under the dropdown... We are pulling the data for the dropdown from API in the plugin and we set those data in globalData of docusaurus. So, on selecting each of the item, we want the corresponding md file to be shown. i have used import().then logic, works fine in dev environment. But when we build the whole site, it is showing as warning, and dynamic imports are not considered during build time. Is there any way or workaround for this to get rid off warning. Any help would be highly appreciated.. thanks Much..

Reproducible demo

No response

Steps to reproduce

Dynamic imports of md file (any file it can be) is not working during docusaurus build process

Expected behavior

Docusaurus should allow to import dynamic files, whether it is img or md file itself into the react component. Works fine in Dev environment and causes warning while building

Actual behavior

Dynamic imports cause warning During build process

Your environment

Self-service

slorber commented 3 months ago

Please provide a runnable https://docusaurus.new/stackblitz sandbox showing the problem.

We can't do anything with the text above, we need to see and be able to run code that fails

Closing until a repro is provided