{"name":"@mdx-js/loader","version":"3.1.0","description":"Webpack loader for MDX","license":"MIT","keywords":["jsx","markdown","mdx","preact","react","remark","vue","webpack"],"homepage":"https://mdxjs.com","repository":{"type":"git","url":"git+https://github.com/mdx-js/mdx.git","directory":"packages/loader/"},"bugs":{"url":"https://github.com/mdx-js/mdx/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"John Otander","email":"johnotander@gmail.com","url":"https://johno.com"},"contributors":[{"name":"John Otander","email":"johnotander@gmail.com","url":"https://johno.com"},{"name":"Tim Neutkens","email":"tim@vercel.com"},{"name":"Matija Marohnić","email":"matija.marohnic@gmail.com"},{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},{"name":"JounQin","email":"admin@1stg.me","url":"https://www.1stg.me"},{"name":"Christian Murphy","email":"christian.murphy.42@gmail.com"}],"type":"module","sideEffects":false,"exports":"./index.cjs","dependencies":{"@mdx-js/mdx":"^3.0.0","source-map":"^0.7.0"},"peerDependencies":{"webpack":">=5"},"peerDependenciesMeta":{"webpack":{"optional":true}},"devDependencies":{},"scripts":{"test":"npm run test-coverage","test-api":"node --conditions development test/index.js","test-coverage":"c8 --100 --reporter lcov npm run test-api"},"xo":{"prettier":true,"rules":{"n/file-extension-in-import":"off"}},"_id":"@mdx-js/loader@3.1.0","gitHead":"eee85d54152499c526cf8c06076be5b563037ff8","_nodeVersion":"23.0.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-xU/lwKdOyfXtQGqn3VnJjlDrmKXEvMi1mgYxVmukEUtVycIz1nh7oQ40bKTd4cA7rLStqu0740pnhGYxGoqsCg==","shasum":"715fdab11d0c9567e45049c16a7d9c83cec88214","tarball":"http://registry-npm.ywwl.com/@mdx-js/loader/download/@mdx-js/loader-3.1.0.tgz","fileCount":9,"unpackedSize":15084,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbuxrtHz28I7Tb1eZakneC4Q/dIcSyUAQYDYTmBDNVIgIgCBvoITna2yB+XElo5DBxvhPJt9mVas7HZLlY9LQX7sQ="}],"size":5796,"noattachment":false,"key":"/@mdx-js/loader/-/@mdx-js/loader-3.1.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/loader_3.1.0_1729264751446_0.3341305411751341"},"_hasShrinkwrap":false,"readme":"# `@mdx-js/loader`\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\nwebpack loader for MDX.\n\n<!-- more -->\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`mdx`](#mdx)\n  * [`Options`](#options)\n* [Examples](#examples)\n  * [Combine with Babel](#combine-with-babel)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a webpack loader to support MDX.\n\n## When should I use this?\n\nThis integration is useful if you’re using webpack (or another tool that uses\nwebpack, such as Next.js or Rspack).\n\nThis integration can be combined with the Babel loader to compile modern\nJavaScript features to ones your users support.\n\nIf you want to evaluate MDX code then the lower-level compiler (`@mdx-js/mdx`)\ncan be used manually.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install @mdx-js/loader\n```\n\n## Use\n\nAdd something along these lines to your `webpack.config.js`:\n\n```tsx\n/**\n * @import {Options} from '@mdx-js/loader'\n * @import {Configuration} from 'webpack'\n */\n\n/** @type {Configuration} */\nconst webpackConfig = {\n  module: {\n    // …\n    rules: [\n      // …\n      {\n        test: /\\.mdx?$/,\n        use: [\n          {\n            loader: '@mdx-js/loader',\n            /** @type {Options} */\n            options: {/* jsxImportSource: …, otherOptions… */}\n          }\n        ]\n      }\n    ]\n  }\n}\n\nexport default webpackConfig\n```\n\nSee also [¶ Next.js][next] and [¶ Vue CLI][vue-cli], if you’re using webpack\nthrough them, for more info.\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`mdx`][api-mdx].\n\n### `mdx`\n\nThis package exports a [webpack][] plugin as the default export.\nConfiguration (see [`Options`][api-options]) are passed separately through\nwebpack.\n\n### `Options`\n\nConfiguration (TypeScript type).\n\nOptions are the same as [`CompileOptions` from `@mdx-js/mdx`][compile-options]\nwith the exception that the `SourceMapGenerator` and `development` options are\nsupported based on how you configure webpack.\nYou cannot pass them manually.\n\n## Examples\n\n### Combine with Babel\n\nIf you use modern JavaScript features you might want to use Babel through\n[`babel-loader`][babel-loader] to compile to code that works in older browsers:\n\n```tsx\n/**\n * @import {Options} from '@mdx-js/loader'\n * @import {Configuration} from 'webpack'\n */\n\n/** @type {Configuration} */\nconst webpackConfig = {\n  module: {\n    // …\n    rules: [\n      // …\n      {\n        test: /\\.mdx?$/,\n        use: [\n          // Note that Webpack runs right-to-left: `@mdx-js/loader` is used first, then\n          // `babel-loader`.\n          {loader: 'babel-loader', options: {}},\n          {\n            loader: '@mdx-js/loader',\n            /** @type {Options} */\n            options: {}\n          }\n        ]\n      }\n    ]\n  }\n}\n\nexport default webpackConfig\n```\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Options`][api-options].\nSee [§ Types][types] on our website for information.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `@mdx-js/loader@^3`,\ncompatible with Node.js 16.\n\n## Security\n\nSee [§ Security][security] on our website for information.\n\n## Contribute\n\nSee [§ Contribute][contribute] on our website for ways to get started.\nSee [§ Support][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][] © Compositor and [Vercel][]\n\n[build-badge]: https://github.com/mdx-js/mdx/workflows/main/badge.svg\n\n[build]: https://github.com/mdx-js/mdx/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/mdx-js/mdx/main.svg\n\n[coverage]: https://codecov.io/github/mdx-js/mdx\n\n[downloads-badge]: https://img.shields.io/npm/dm/@mdx-js/loader.svg\n\n[downloads]: https://www.npmjs.com/package/@mdx-js/loader\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/mdx-js/mdx/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[contribute]: https://mdxjs.com/community/contribute/\n\n[support]: https://mdxjs.com/community/support/\n\n[coc]: https://github.com/mdx-js/.github/blob/main/code-of-conduct.md\n\n[mit]: https://github.com/mdx-js/mdx/blob/main/packages/loader/license\n\n[vercel]: https://vercel.com\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[security]: https://mdxjs.com/getting-started/#security\n\n[types]: https://mdxjs.com/getting-started/#types\n\n[webpack]: https://webpack.js.org\n\n[compile-options]: https://mdxjs.com/packages/mdx/#compileoptions\n\n[typescript]: https://www.typescriptlang.org\n\n[babel-loader]: https://webpack.js.org/loaders/babel-loader/\n\n[next]: https://mdxjs.com/getting-started/#nextjs\n\n[vue-cli]: https://mdxjs.com/getting-started/#vue-cli\n\n[api-mdx]: #mdx\n\n[api-options]: #options\n","publish_time":1729264751599,"maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"},{"name":"johno","email":"johnotander@gmail.com"},{"name":"timneutkens","email":"timneutkens@icloud.com"},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_cnpm_publish_time":1729264751599,"dist-tags":{"ci":"2.0.0-ci.53","latest":"3.1.1","next":"2.0.0-rc.2"}}