Skip to content

Using mdx without React #166

@TheKnarf

Description

@TheKnarf
./node_modules/@mdx-js/tag/dist/mdx-tag.js
  0:0  error  Module not found: Error: Can't resolve 'react' in
              '/Users/fl-macbook-retina/Dropbox/Projects/node_js_server/node_modules/@mdx-js/tag/dist'

I wanna use Mdx for a project where I'm not using React but something similar. In my Webpack config I've configured babel the following way to not transform Jsx into React.createElement but into just dom. Can I get MDX to threat Jsx the same way?

{
        loader: 'babel-loader',
        options: {
                presets: ['env', 'react'],
                plugins: [
                        ["transform-react-jsx", {
                                "pragma": "dom" // default pragma is React.createElement
                        }]
                ]
        }
},

Seems like it's not currently possible?

I believe it would be if one could make the following line a configuration option:
https://github.com/mdx-js/mdx/blob/master/packages/loader/index.js#L10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions