Replies: 2 comments
-
Hi, It make sense to load that JSON file both as a webpack asset and a json module, and it seems it's trying to do both at the same time. We have webpack loader for code (including json), and webpack loader for assets enabling convenient linking https://v2.docusaurus.io/docs/next/markdown-features/assets/#files We should probably make exceptions for markdown links linking to .js, .jsx, .ts, .ts, .json files as in such case we definitively want to link to the file instead of loading that file as a module. In the meantime you can use this
|
Beta Was this translation helpful? Give feedback.
-
I see. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I have an
openapi.json
file in my static directory, but whenever I link to it in Markdown like this:I get a Webpack error.
Apparently, Webpack is trying to load it as a JS module, for some reason.
If I change the file extension to '.txt', it works, but the rendered URL includes a version hash.
I understand the rationale, but it's still confusing to me (and I can't see an easy way to override it). My workaround was to hardcode the link using an
<a>
tag. Is there a way to specify what static assets should be served as-is? If not, could we add this feature?Beta Was this translation helpful? Give feedback.
All reactions