Skip to content

Commit 8813393

Browse files
authored
chore(deps): bump remark-mdx-frontmatter from 1.0.1 to 5.2.0 (#6645)
* chore(deps): bump remark-mdx-frontmatter from 1.0.1 to 5.2.0 * simplify remark-mdx-frontmatter import logic * use const
1 parent 86c2d07 commit 8813393

File tree

3 files changed

+123
-24
lines changed

3 files changed

+123
-24
lines changed

docs/next.config.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ const BRANCH = gitHead === 'HEAD' ? 'main' : gitHead;
88

99
const withNextPluginPreval = require('next-plugin-preval/config')();
1010

11+
let remarkMdxFrontmatterModule = null;
12+
13+
function createRemarkMdxFrontmatterPlugin(options = {}) {
14+
return async function remarkMdxFrontmatterPlugin(tree, file) {
15+
if (!remarkMdxFrontmatterModule) {
16+
remarkMdxFrontmatterModule = await import('remark-mdx-frontmatter');
17+
}
18+
19+
const actualPlugin = remarkMdxFrontmatterModule.default;
20+
21+
const pluginInstance = actualPlugin(options);
22+
23+
return pluginInstance.call(this, tree, file);
24+
};
25+
}
26+
1127
module.exports = withNextPluginPreval({
1228
env: {
1329
BRANCH,
@@ -230,10 +246,8 @@ module.exports = withNextPluginPreval({
230246
// Remove frontmatter from MDX
231247
require('remark-frontmatter'),
232248
// Extract to `frontmatter` export
233-
[
234-
require('remark-mdx-frontmatter').remarkMdxFrontmatter,
235-
{ name: 'frontmatter' },
236-
],
249+
// Use the custom plugin wrapper that handles dynamic import
250+
[createRemarkMdxFrontmatterPlugin, { name: 'frontmatter' }],
237251
require('./src/plugins/remark-layout'),
238252
]),
239253
},

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"remark-frontmatter": "^3.0.0",
5252
"remark-gfm": "^1.0.0",
5353
"remark-github": "^10.1.0",
54-
"remark-mdx-frontmatter": "^1.0.1",
54+
"remark-mdx-frontmatter": "^5.2.0",
5555
"remark-mdx-images": "^1.0.2",
5656
"rimraf": "^3.0.2",
5757
"sass": "^1.43.4",

yarn.lock

Lines changed: 104 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)