Replies: 1 comment
-
Whoops, just realized this should be in the Remark discussion board. Apologies; I didn’t understand the link structure when I first clicked through on the support doc. I’ll close this and re-ask the question over there. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This might be a pretty narrow use case, but I was curious about support for using using just the to markdown components of remark-gfm or mdast-util-gfm (since by default it sets up both the from and to components). Mainly what I’m concerned about here is byte size in my JS bundle — including just the
gfmToMarkdown
component ofmdast-util-gfm
saves 23 KB in my production JS bundle (about 20% of the overall bundle size at the moment).Due to the way things are set up right now, the best way I can figure to do this makes me kind of unhappy:
First off, I’d love to know if I’m missing something obvious and there’s a more correct way to do this. Some of the constraints I was hoping to adhere to are:
mdast-util-gfm
instead of the individual feature extensions if possible, so I don’t have to keep up with new packages being added or removed for GFM.remark-stringify
instead ofmdast-util-to-markdown
since that’s the recommended approach, and it does some work to make integration with other plugins just work.Otherwise, am I worrying to much about these constraints? Should I just use
mdast-util-to-markdown
so I can register extensions directly in its options, and not worry about what I might be missing fromremark-stringify
?Or would it be reasonable to change one of the involved packages to make this kind of usage easier? (Maybe
remark-stringify
could merge anextensions
array you pass in directly with the stuff it grabs fromtoMarkdownExtensions
? Or mayberemark-gfm
could have a function to register only the to or only the from Markdown extensions, enabling tree shaking when bundling?Beta Was this translation helpful? Give feedback.
All reactions