Neutrino middleware for MDX files in React apps
- Node.js v10+
- Neutrino v9
- React
- Webpack v4
@constgen/neutrino-mdx-loader
can be installed from NPM. You should install it to "dependencies"
(--save) or "devDependncies"
(--save-dev) depending on your goal.
npm install --save @constgen/neutrino-mdx-loader
Require this package and plug it into Neutrino. The middleware has no options:
let mdxLoader = require('@constgen/neutrino-mdx-loader')
neutrino.use(mdxLoader())
The middleware also may be used together with another presets in Neutrino rc-file, e.g.:
.neutrinorc.js
let mdxLoader = require('@constgen/neutrino-mdx-loader')
module.exports = {
use: [
mdxLoader()
]
}
If you'd like to add styles for the syntax highlighting, include a Prism.js stylesheet somewhere within your application:
import 'prismjs/themes/prism-tomorrow.css'