Open robations opened 3 years ago
Can you provide full configuration? I can't reproduce, example from README works fine
Hi @alexander-akait, thanks very much for your reply. My main point was that it's unclear from the docs what should be happening. Can you clarify what I should get when importing a .md module (let's say with the RemarkHTML plugin)?
But my guess is that what I'm seeing is not correct, for whatever reason (wrong dependency versions? conflict with webpack ecosystem?).
But if I can create a minimal reproduction of what I'm seeing, I will post — maybe won't have time until the weekend.
@robations You should get html in your case
You don't need fetch
here, because your content will be inlined in files, if you want to use fetch
you need to using assets modules
(resource)
Thanks, yes I was expecting to see html at first.
What I'm seeing is more like what happens if you import a .jpg
file, you get an image URL that can be passed to (e.g.) <img src={theImage}/>
. The other webpack rules have file extension tests that should exclude markdown, but something must be converting the import to return a URL. I'll do some more digging.
Expected Behavior
The examples in readme show
console.log()
but not what might be returned.This might also be a bug, but I can't tell at the moment.
Do we expect...
OR
fetch()
?Actual Behavior
Importing a markdown doc returns a path to a compiled JS file, so accessing the raw html requires a double import. Though webpack IIRC won't handle double imports (too dynamic to know what the path will be).
Code
NB There are some other webpack module rules applied (fairly standard rules for handling images, css, JS), but at the moment I can't see how/if they impact on the remark-loader behaviour.