@docusaurus/plugin-content-pages 0.0.0-6067 → 0.0.0-6069

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/index.js +23 -23
  2. package/package.json +7 -7
  3. package/src/index.ts +30 -30
package/lib/index.js CHANGED
@@ -23,33 +23,33 @@ async function pluginContentPages(context, options) {
23
23
  async function createPagesMDXLoaderRule() {
24
24
  const { admonitions, rehypePlugins, remarkPlugins, recmaPlugins, beforeDefaultRehypePlugins, beforeDefaultRemarkPlugins, } = options;
25
25
  const contentDirs = (0, content_1.getContentPathList)(contentPaths);
26
- const loaderOptions = {
27
- admonitions,
28
- remarkPlugins,
29
- rehypePlugins,
30
- recmaPlugins,
31
- beforeDefaultRehypePlugins,
32
- beforeDefaultRemarkPlugins,
33
- staticDirs: siteConfig.staticDirectories.map((dir) => path_1.default.resolve(siteDir, dir)),
34
- siteDir,
35
- isMDXPartial: (0, utils_1.createAbsoluteFilePathMatcher)(options.exclude, contentDirs),
36
- metadataPath: (mdxPath) => {
37
- // Note that metadataPath must be the same/in-sync as
38
- // the path from createData for each MDX.
39
- const aliasedSource = (0, utils_1.aliasedSitePath)(mdxPath, siteDir);
40
- return path_1.default.join(dataDir, `${(0, utils_1.docuHash)(aliasedSource)}.json`);
41
- },
42
- // createAssets converts relative paths to require() calls
43
- createAssets: ({ frontMatter }) => ({
44
- image: frontMatter.image,
45
- }),
46
- markdownConfig: siteConfig.markdown,
47
- };
48
26
  return (0, mdx_loader_1.createMDXLoaderRule)({
49
27
  include: contentDirs
50
28
  // Trailing slash is important, see https://github.com/facebook/docusaurus/pull/3970
51
29
  .map(utils_1.addTrailingPathSeparator),
52
- options: loaderOptions,
30
+ options: {
31
+ useCrossCompilerCache: siteConfig.future.experimental_faster.mdxCrossCompilerCache,
32
+ admonitions,
33
+ remarkPlugins,
34
+ rehypePlugins,
35
+ recmaPlugins,
36
+ beforeDefaultRehypePlugins,
37
+ beforeDefaultRemarkPlugins,
38
+ staticDirs: siteConfig.staticDirectories.map((dir) => path_1.default.resolve(siteDir, dir)),
39
+ siteDir,
40
+ isMDXPartial: (0, utils_1.createAbsoluteFilePathMatcher)(options.exclude, contentDirs),
41
+ metadataPath: (mdxPath) => {
42
+ // Note that metadataPath must be the same/in-sync as
43
+ // the path from createData for each MDX.
44
+ const aliasedSource = (0, utils_1.aliasedSitePath)(mdxPath, siteDir);
45
+ return path_1.default.join(dataDir, `${(0, utils_1.docuHash)(aliasedSource)}.json`);
46
+ },
47
+ // createAssets converts relative paths to require() calls
48
+ createAssets: ({ frontMatter }) => ({
49
+ image: frontMatter.image,
50
+ }),
51
+ markdownConfig: siteConfig.markdown,
52
+ },
53
53
  });
54
54
  }
55
55
  const pagesMDXLoaderRule = await createPagesMDXLoaderRule();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-pages",
3
- "version": "0.0.0-6067",
3
+ "version": "0.0.0-6069",
4
4
  "description": "Pages plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/plugin-content-pages.d.ts",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@docusaurus/core": "0.0.0-6067",
22
- "@docusaurus/mdx-loader": "0.0.0-6067",
23
- "@docusaurus/types": "0.0.0-6067",
24
- "@docusaurus/utils": "0.0.0-6067",
25
- "@docusaurus/utils-validation": "0.0.0-6067",
21
+ "@docusaurus/core": "0.0.0-6069",
22
+ "@docusaurus/mdx-loader": "0.0.0-6069",
23
+ "@docusaurus/types": "0.0.0-6069",
24
+ "@docusaurus/utils": "0.0.0-6069",
25
+ "@docusaurus/utils-validation": "0.0.0-6069",
26
26
  "fs-extra": "^11.1.1",
27
27
  "tslib": "^2.6.0",
28
28
  "webpack": "^5.88.1"
@@ -34,5 +34,5 @@
34
34
  "engines": {
35
35
  "node": ">=18.0"
36
36
  },
37
- "gitHead": "856911a5474e8e907f83438abe5c42d4793e06cb"
37
+ "gitHead": "7258877748d2a7c1682c5c92dae3a17734a7e59e"
38
38
  }
package/src/index.ts CHANGED
@@ -14,10 +14,7 @@ import {
14
14
  createAbsoluteFilePathMatcher,
15
15
  DEFAULT_PLUGIN_ID,
16
16
  } from '@docusaurus/utils';
17
- import {
18
- createMDXLoaderRule,
19
- type Options as MDXLoaderOptions,
20
- } from '@docusaurus/mdx-loader';
17
+ import {createMDXLoaderRule} from '@docusaurus/mdx-loader';
21
18
  import {createAllRoutes} from './routes';
22
19
  import {
23
20
  createPagesContentPaths,
@@ -57,36 +54,39 @@ export default async function pluginContentPages(
57
54
  } = options;
58
55
  const contentDirs = getContentPathList(contentPaths);
59
56
 
60
- const loaderOptions: MDXLoaderOptions = {
61
- admonitions,
62
- remarkPlugins,
63
- rehypePlugins,
64
- recmaPlugins,
65
- beforeDefaultRehypePlugins,
66
- beforeDefaultRemarkPlugins,
67
- staticDirs: siteConfig.staticDirectories.map((dir) =>
68
- path.resolve(siteDir, dir),
69
- ),
70
- siteDir,
71
- isMDXPartial: createAbsoluteFilePathMatcher(options.exclude, contentDirs),
72
- metadataPath: (mdxPath: string) => {
73
- // Note that metadataPath must be the same/in-sync as
74
- // the path from createData for each MDX.
75
- const aliasedSource = aliasedSitePath(mdxPath, siteDir);
76
- return path.join(dataDir, `${docuHash(aliasedSource)}.json`);
77
- },
78
- // createAssets converts relative paths to require() calls
79
- createAssets: ({frontMatter}: {frontMatter: PageFrontMatter}) => ({
80
- image: frontMatter.image,
81
- }),
82
- markdownConfig: siteConfig.markdown,
83
- };
84
-
85
57
  return createMDXLoaderRule({
86
58
  include: contentDirs
87
59
  // Trailing slash is important, see https://github.com/facebook/docusaurus/pull/3970
88
60
  .map(addTrailingPathSeparator),
89
- options: loaderOptions,
61
+ options: {
62
+ useCrossCompilerCache:
63
+ siteConfig.future.experimental_faster.mdxCrossCompilerCache,
64
+ admonitions,
65
+ remarkPlugins,
66
+ rehypePlugins,
67
+ recmaPlugins,
68
+ beforeDefaultRehypePlugins,
69
+ beforeDefaultRemarkPlugins,
70
+ staticDirs: siteConfig.staticDirectories.map((dir) =>
71
+ path.resolve(siteDir, dir),
72
+ ),
73
+ siteDir,
74
+ isMDXPartial: createAbsoluteFilePathMatcher(
75
+ options.exclude,
76
+ contentDirs,
77
+ ),
78
+ metadataPath: (mdxPath: string) => {
79
+ // Note that metadataPath must be the same/in-sync as
80
+ // the path from createData for each MDX.
81
+ const aliasedSource = aliasedSitePath(mdxPath, siteDir);
82
+ return path.join(dataDir, `${docuHash(aliasedSource)}.json`);
83
+ },
84
+ // createAssets converts relative paths to require() calls
85
+ createAssets: ({frontMatter}: {frontMatter: PageFrontMatter}) => ({
86
+ image: frontMatter.image,
87
+ }),
88
+ markdownConfig: siteConfig.markdown,
89
+ },
90
90
  });
91
91
  }
92
92