Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@mdx-js/rollup
Advanced tools
@mdx-js/rollup
Rollup plugin for MDX.
This package is a Rollup plugin to support MDX.
This integration is useful if you’re using Rollup (or another tool that uses Rollup, such as Vite).
This integration can be combined with the Babel plugin to support nonstandard JSX runtimes (such as Vue) or compile modern JavaScript features to ones your users support.
If you want to evaluate MDX code then the lower-level compiler (@mdx-js/mdx
)
can be used manually.
This package is ESM only:
Node 12+ is needed to use it and it must be import
ed instead of require
d.
npm:
npm install @mdx-js/rollup
yarn:
yarn add @mdx-js/rollup
Add something along these lines to your rollup.config.js
:
import mdx from '@mdx-js/rollup'
export default {
// …
plugins: [
// …
mdx({/* Options… */})
]
}
See also ¶ Vite and ¶ WMR, if you’re using Rollup through them, for more info.
This package exports a Rollup plugin as the default export.
Source maps are supported based on how you configure Rollup.
You do not need to pass options.SourceMapGenerator
.
options
options
are the same as compile
from @mdx-js/mdx
, with the
additions of:
options.include
options.exclude
List of picomatch
patterns to include and/or exclude
(string
, RegExp
, Array<string|RegExp>
, default: []
).
If you use modern JavaScript features you might want to use Babel through
@rollup/plugin-babel
to compile to code that works:
// …
import {babel} from '@rollup/plugin-babel'
export default {
// …
plugins: [
// …
mdx({/* Options… */}),
babel({
// Also run on what used to be `.mdx` (but is now JS):
extensions: ['.js', '.jsx', '.cjs', '.mjs', '.md', '.mdx'],
// Other options…
})
]
}
This package is fully typed with TypeScript. See § Types on our website for information.
An Options
type is exported, which represents acceptable configuration.
See § Security on our website for information.
See § Contribute on our website for ways to get started. See § Support for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
Rollup plugin for MDX
The npm package @mdx-js/rollup receives a total of 30,433 weekly downloads. As such, @mdx-js/rollup popularity was classified as popular.
We found that @mdx-js/rollup demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.