Open daniel-ac-martin opened 2 years ago
@shilman: Any thoughts on this?
Sorry for the slow reply. That sounds likely a reasonable feature request. Any chance you can create a PR for this?
@shilman: I've already raised #10. (But it looks like you've seen that now. :-) )
I'm trying to migrate to this package and away from using mdx-loader (v1) with
createDocsCompiler
.My repo uses a custom pragma for React so that JSX elements are compiled to
h(Component, props)
rather thanReact.createElement(Component, props)
. With the previous set-up this was fine as long as I used my babel loader after mds-loader.However that is not the case with this package. The culprit seems to be the
DEFAULT_RENDERER
that is defined inloader.js
.I'd suggest that the loader take some new options to allow configuration of this. It should be possible to mirror mdx-loader. i.e:
options.pragma
(default:React.createElement
)options.pragmaImportSource
(default:react
)(Aside, does allowing the configuration of the source have any value?)
See: https://mdxjs.com/packages/mdx/#optionspragma