Skip to content

fix(dev): update remark-mdx-frontmatter #10579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/guides/mdx.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ Clearly this is not a scalable solution for a blog with thousands of posts. Real
If you wish to configure your own remark plugins you can do so through the `remix.config.js`'s `mdx` export:

```js filename=remix.config.js
const {
remarkMdxFrontmatter,
} = require("remark-mdx-frontmatter");
import remarkMdxFrontmatter from "remark-mdx-frontmatter";

// can be an sync / async function or an object
exports.mdx = async (filename) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-dev/compiler/plugins/mdx.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { promises as fsp } from "node:fs";
import * as path from "node:path";
import type * as esbuild from "esbuild";
import { remarkMdxFrontmatter } from "remark-mdx-frontmatter";

import { getLoaderForFile } from "../utils/loaders";
import { createMatchPath } from "../utils/tsconfig";
Expand Down Expand Up @@ -70,6 +69,7 @@ export async function processMDX(
) {
try {
let fileContents = await fsp.readFile(absolutePath, "utf-8");
let remarkMdxFrontmatter = (await import("remark-mdx-frontmatter")).default;

let rehypePlugins = [];
let remarkPlugins: any[] = [
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"pretty-ms": "^7.0.1",
"react-refresh": "^0.14.0",
"remark-frontmatter": "4.0.1",
"remark-mdx-frontmatter": "^1.0.1",
"remark-mdx-frontmatter": "^5.1.0",
"semver": "^7.3.7",
"set-cookie-parser": "^2.6.0",
"tar-fs": "^2.1.1",
Expand Down
52 changes: 31 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading