@rspress/core 2.0.12 → 2.0.13

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 (99) hide show
  1. package/dist/0~execa.js +1 -1
  2. package/dist/{8857.js → 5580.js} +2 -2
  3. package/dist/{1688.js → 7275.js} +6 -1
  4. package/dist/{8006.js → 7986.js} +1 -6
  5. package/dist/cli/index.js +4 -4
  6. package/dist/config/loadConfigFile.js +1 -1
  7. package/dist/eject-theme/components/CodeBlock/index.test.tsx +49 -0
  8. package/dist/eject-theme/components/CodeBlock/index.tsx +1 -1
  9. package/dist/eject-theme/components/CodeButtonGroup/index.tsx +5 -2
  10. package/dist/eject-theme/components/FallbackHeading/index.test.tsx +45 -0
  11. package/dist/eject-theme/components/FallbackHeading/index.tsx +1 -1
  12. package/dist/eject-theme/components/Link/useLinkNavigate.ts +2 -2
  13. package/dist/eject-theme/components/Overview/index.test.tsx +57 -0
  14. package/dist/eject-theme/components/Overview/index.tsx +1 -1
  15. package/dist/eject-theme/components/OverviewGroup/index.test.tsx +61 -0
  16. package/dist/eject-theme/components/OverviewGroup/index.tsx +1 -1
  17. package/dist/eject-theme/components/PackageManagerTabs/index.test.tsx +54 -0
  18. package/dist/eject-theme/components/PackageManagerTabs/index.tsx +1 -1
  19. package/dist/eject-theme/components/Steps/index.scss +6 -4
  20. package/dist/eject-theme/components/Tabs/index.test.tsx +51 -0
  21. package/dist/eject-theme/components/Tabs/index.tsx +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/node/PluginDriver.js +1 -1
  24. package/dist/node/auto-nav-sidebar/index.js +1 -1
  25. package/dist/node/auto-nav-sidebar/locales.js +1 -1
  26. package/dist/node/auto-nav-sidebar/normalize.js +3 -4
  27. package/dist/node/auto-nav-sidebar/utils.js +1 -1
  28. package/dist/node/auto-nav-sidebar/walk.js +1 -1
  29. package/dist/node/constants.js +3 -3
  30. package/dist/node/eject.js +2 -2
  31. package/dist/node/initRsbuild.js +5 -8
  32. package/dist/node/logger/hint.js +1 -1
  33. package/dist/node/mdx/options.js +1 -1
  34. package/dist/node/mdx/processor.js +1 -1
  35. package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
  36. package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -1
  37. package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
  38. package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
  39. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +2 -2
  40. package/dist/node/mdx/remarkPlugins/image.js +3 -4
  41. package/dist/node/mdx/remarkPlugins/link.js +2 -2
  42. package/dist/node/mdx/remarkPlugins/toc.js +1 -1
  43. package/dist/node/medium-zoom/index.js +1 -1
  44. package/dist/node/route/RoutePage.js +1 -1
  45. package/dist/node/route/RouteService.js +2 -3
  46. package/dist/node/route/extractPageData.js +1 -1
  47. package/dist/node/route/normalizeRoutePath.js +1 -1
  48. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +119 -112
  49. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.js +7 -0
  50. package/dist/node/runtimeModule/i18n.js +2 -2
  51. package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
  52. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
  53. package/dist/node/runtimeModule/searchHooks.js +1 -1
  54. package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
  55. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
  56. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
  57. package/dist/node/serve.js +1 -1
  58. package/dist/node/ssg/renderPage.js +2 -2
  59. package/dist/node/ssg/renderPageWorker.js +2 -2
  60. package/dist/node/ssg/renderPages.js +3 -3
  61. package/dist/node/ssg/rsbuildPluginSSG.js +1 -1
  62. package/dist/node/ssg/ssgEnv.js +1 -1
  63. package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
  64. package/dist/node/ssg-md/llms/llmsTxt.js +1 -1
  65. package/dist/node/ssg-md/remarkSplitMdx.js +1 -1
  66. package/dist/node/ssg-md/renderPage.js +2 -2
  67. package/dist/node/ssg-md/renderPages.js +3 -3
  68. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
  69. package/dist/node/utils/checkLanguageParity.js +1 -1
  70. package/dist/node/utils/createHash.js +1 -1
  71. package/dist/node/utils/error.js +1 -1
  72. package/dist/node/utils/flattenMdxContent.js +1 -1
  73. package/dist/node/utils/fs.js +1 -1
  74. package/dist/node/utils/getPageKey.js +1 -1
  75. package/dist/node/utils/normalizePath.js +1 -1
  76. package/dist/node/utils/reactAlias.js +2 -2
  77. package/dist/runtime/App.js +1 -1
  78. package/dist/theme/components/CodeBlock/index.js +1 -1
  79. package/dist/theme/components/CodeButtonGroup/index.js +4 -2
  80. package/dist/theme/components/FallbackHeading/index.js +1 -1
  81. package/dist/theme/components/Link/useLinkNavigate.js +2 -2
  82. package/dist/theme/components/Overview/index.js +1 -1
  83. package/dist/theme/components/OverviewGroup/index.js +1 -1
  84. package/dist/theme/components/PackageManagerTabs/index.js +1 -1
  85. package/dist/theme/components/Steps/index.css +6 -4
  86. package/dist/theme/components/Tabs/index.js +1 -1
  87. package/dist/theme/layout/DocLayout/index.js +1 -1
  88. package/dist/theme/layout/HomeLayout/index.js +1 -1
  89. package/dist/theme/layout/Layout/index.js +1 -1
  90. package/package.json +6 -6
  91. package/dist/runtime/BrowserOnly.test.d.ts +0 -1
  92. /package/dist/{0~1402.js → 0~8787.js} +0 -0
  93. /package/dist/{2235.js → 2633.js} +0 -0
  94. /package/dist/{3323.js → 3358.js} +0 -0
  95. /package/dist/{8857.js.LICENSE.txt → 5580.js.LICENSE.txt} +0 -0
  96. /package/dist/{9224.js → 559.js} +0 -0
  97. /package/dist/{3294.js → 8005.js} +0 -0
  98. /package/dist/{6162.js → 9283.js} +0 -0
  99. /package/dist/{8474.js → 9882.js} +0 -0
@@ -1,6 +1,6 @@
1
- import { workerData } from "../../9224.js";
1
+ import { workerData } from "../../559.js";
2
2
  import { createError } from "../utils/error.js";
3
- import { pMap } from "../../1688.js";
3
+ import { pMap } from "../../7275.js";
4
4
  import { renderPage } from "./renderPage.js";
5
5
  const params = workerData?.[1]?.params;
6
6
  if (!params) throw createError('SSG Worker Thread workerData params missing');
@@ -1,9 +1,9 @@
1
1
  /*! LICENSE: renderPages.js.LICENSE.txt */
2
2
  import { __webpack_require__ } from "../../0~rslib-runtime.js";
3
- import "../../8006.js";
4
- import { chunk, logger } from "../../2235.js";
3
+ import "../../7986.js";
4
+ import { chunk, logger } from "../../2633.js";
5
5
  import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
6
- import { pMap } from "../../1688.js";
6
+ import { pMap } from "../../7275.js";
7
7
  import { renderPage } from "./renderPage.js";
8
8
  import { hintSSGFailed } from "../logger/hint.js";
9
9
  import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
@@ -1,4 +1,4 @@
1
- import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../2235.js";
1
+ import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../2633.js";
2
2
  import { NODE_SSG_BUNDLE_FOLDER, NODE_SSG_BUNDLE_NAME } from "../constants.js";
3
3
  import { renderPages } from "./renderPages.js";
4
4
  const rsbuildPluginSSG = ({ routeService, config })=>({
@@ -1,5 +1,5 @@
1
1
  /*! LICENSE: ssgEnv.js.LICENSE.txt */
2
- import { node_os } from "../../2235.js";
2
+ import { node_os } from "../../2633.js";
3
3
  /**
4
4
  * these codes are copied from
5
5
  * @link https://github.com/facebook/docusaurus/blob/45065e8d2b5831117b8d69fec1be28f5520cf105/packages/docusaurus/src/ssg/ssgEnv.ts#L11
@@ -1,4 +1,4 @@
1
- import { matchPath, getSidebarDataGroup } from "../../../2235.js";
1
+ import { matchPath, getSidebarDataGroup } from "../../../2633.js";
2
2
  import { generateLlmsTxt, generateLlmsFullTxt } from "./llmsTxt.js";
3
3
  async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
4
4
  const base = config.base ?? '/';
@@ -1,4 +1,4 @@
1
- import { normalizeHref, logger, withBase } from "../../../2235.js";
1
+ import { normalizeHref, logger, withBase } from "../../../2633.js";
2
2
  import { extractInfoFromFrontmatterWithAbsolutePath } from "../../auto-nav-sidebar/utils.js";
3
3
  function routePathToMdPath(routePath, base) {
4
4
  let url = routePath;
@@ -1,4 +1,4 @@
1
- import { unified, visit, remark_gfm, remark_mdx, remark_stringify } from "../../6162.js";
1
+ import { unified, visit, remark_gfm, remark_mdx, remark_stringify } from "../../9283.js";
2
2
  function remarkSplitMdx(options = {}) {
3
3
  return (tree)=>{
4
4
  const newChildren = [];
@@ -1,6 +1,6 @@
1
1
  import { __webpack_require__ } from "../../0~rslib-runtime.js";
2
- import "../../8006.js";
3
- import { createHead, pathToFileURL, logger } from "../../2235.js";
2
+ import "../../7986.js";
3
+ import { createHead, pathToFileURL, logger } from "../../2633.js";
4
4
  import { hintSSGFailed } from "../logger/hint.js";
5
5
  const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
6
6
  var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
@@ -1,7 +1,7 @@
1
1
  import { __webpack_require__ } from "../../0~rslib-runtime.js";
2
- import "../../8006.js";
3
- import { logger } from "../../2235.js";
4
- import { pMap } from "../../1688.js";
2
+ import "../../7986.js";
3
+ import { logger } from "../../2633.js";
4
+ import { pMap } from "../../7275.js";
5
5
  import { renderPage } from "./renderPage.js";
6
6
  import { SSGConcurrency } from "../ssg/ssgEnv.js";
7
7
  const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
@@ -1,4 +1,4 @@
1
- import { writeFile, mkdir, rm, join, isDebugMode } from "../../2235.js";
1
+ import { writeFile, mkdir, rm, join, isDebugMode } from "../../2633.js";
2
2
  import { NODE_SSG_MD_BUNDLE_FOLDER, NODE_SSG_MD_BUNDLE_NAME } from "../constants.js";
3
3
  import { renderPages } from "./renderPages.js";
4
4
  import { emitLlmsTxt } from "./llms/emitLlmsTxt.js";
@@ -1,4 +1,4 @@
1
- import { node_path, logger, promises } from "../../2235.js";
1
+ import { node_path, logger, promises } from "../../2633.js";
2
2
  import { createError } from "./error.js";
3
3
  function normalizePath(filePath) {
4
4
  return filePath.split(node_path.sep).join('/');
@@ -1,4 +1,4 @@
1
- import { createHash as external_node_crypto_createHash } from "../../2235.js";
1
+ import { createHash as external_node_crypto_createHash } from "../../2633.js";
2
2
  function createHash(str) {
3
3
  return external_node_crypto_createHash('sha256').update(str).digest('hex').slice(0, 8);
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import { __webpack_require__ } from "../../0~rslib-runtime.js";
2
- import "../../8006.js";
2
+ import "../../7986.js";
3
3
  const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
4
4
  var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
5
5
  function createError(message, maxStackLines = 5) {
@@ -1,4 +1,4 @@
1
- import { node_fs, node_path, core_rspack, logger, createProcessor, MDX_OR_MD_REGEXP } from "../../2235.js";
1
+ import { node_fs, node_path, core_rspack, logger, createProcessor, MDX_OR_MD_REGEXP } from "../../2633.js";
2
2
  import { createError } from "./error.js";
3
3
  import { importStatementRegex } from "../constants.js";
4
4
  const RspackResolveFactory = core_rspack.experiments.resolver.ResolverFactory;
@@ -1,4 +1,4 @@
1
- import { promises } from "../../8006.js";
1
+ import { promises } from "../../7986.js";
2
2
  async function pathExists(path) {
3
3
  try {
4
4
  await promises.access(path);
@@ -1,4 +1,4 @@
1
- import { removeLeadingSlash } from "../../2235.js";
1
+ import { removeLeadingSlash } from "../../2633.js";
2
2
  function getPageKey(route) {
3
3
  const cleanRoute = removeLeadingSlash(route);
4
4
  return cleanRoute.replace(/\//g, '_').replace(/\.[^.]+$/, '') || 'index';
@@ -1,4 +1,4 @@
1
- import { node_os, node_path } from "../../3294.js";
1
+ import { node_os, node_path } from "../../8005.js";
2
2
  const isWindows = 'win32' === node_os.platform();
3
3
  function slash(p) {
4
4
  return p.replace(/\\/g, '/');
@@ -1,6 +1,6 @@
1
1
  import { __webpack_require__ } from "../../0~rslib-runtime.js";
2
- import "../../8006.js";
3
- import { node_path, core_rspack, logger } from "../../2235.js";
2
+ import "../../7986.js";
3
+ import { node_path, core_rspack, logger } from "../../2633.js";
4
4
  import { pathExists, readJson } from "./fs.js";
5
5
  import { PACKAGE_ROOT } from "../constants.js";
6
6
  import { hintReactVersion } from "../logger/hint.js";
@@ -29,7 +29,7 @@ function App() {
29
29
  const GLOBAL_COMPONENTS_KEY = 'globalUIComponents';
30
30
  const query = new URLSearchParams(search);
31
31
  const hideGlobalUIComponents = false === frontmatter[GLOBAL_COMPONENTS_KEY] || "0" === query.get(GLOBAL_COMPONENTS_KEY);
32
- if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Root, {
32
+ if (import.meta.env.SSG_MD) return /*#__PURE__*/ jsx(Root, {
33
33
  children: /*#__PURE__*/ jsx(Layout, {})
34
34
  });
35
35
  return /*#__PURE__*/ jsxs(Root, {
@@ -5,7 +5,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
5
5
  import "./index.css";
6
6
  const DEFAULT_FOLD_HEIGHT = 300;
7
7
  function CodeBlock({ containerElementClassName, title, lang = 'txt', wrapCode: wrapCodeProp = false, lineNumbers: lineNumbersProp = false, fold = false, height, codeButtonGroupProps, children }) {
8
- if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Fragment, {
8
+ if (import.meta.env.SSG_MD) return /*#__PURE__*/ jsx(Fragment, {
9
9
  children: children
10
10
  });
11
11
  const { wrapCode: wrapCodeState, toggleWrapCode, copyElementRef } = useCodeButtonGroup(wrapCodeProp);
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { useSite } from "@rspress/core/runtime";
2
+ import { useI18n, useSite } from "@rspress/core/runtime";
3
3
  import { IconWrap, IconWrapped, SvgWrapper } from "@rspress/core/theme";
4
4
  import clsx from "clsx";
5
5
  import { useRef, useState } from "react";
@@ -20,6 +20,7 @@ const useCodeButtonGroup = (initialWrapCode)=>{
20
20
  };
21
21
  };
22
22
  function CodeButtonGroup({ wrapCode, toggleWrapCode, copyElementRef, showWrapCodeButton = true, showCopyButton = true }) {
23
+ const t = useI18n();
23
24
  return /*#__PURE__*/ jsx(Fragment, {
24
25
  children: /*#__PURE__*/ jsxs("div", {
25
26
  className: "rp-code-button-group",
@@ -27,7 +28,8 @@ function CodeButtonGroup({ wrapCode, toggleWrapCode, copyElementRef, showWrapCod
27
28
  showWrapCodeButton && /*#__PURE__*/ jsxs("button", {
28
29
  className: clsx('rp-code-button-group__button', 'rp-code-wrap-button', wrapCode && 'rp-code-wrap-button--wrapped'),
29
30
  onClick: ()=>toggleWrapCode(),
30
- title: "Toggle code wrap",
31
+ title: t('codeButtonGroupWrapButtonText'),
32
+ "aria-label": t('codeButtonGroupWrapButtonText'),
31
33
  children: [
32
34
  /*#__PURE__*/ jsx(SvgWrapper, {
33
35
  icon: IconWrapped,
@@ -14,7 +14,7 @@ const getHeadingMap = ()=>{
14
14
  };
15
15
  };
16
16
  function FallbackHeading({ level, title }) {
17
- if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Fragment, {
17
+ if (import.meta.env.SSG_MD) return /*#__PURE__*/ jsx(Fragment, {
18
18
  children: `${'#'.repeat(level)} ${title}\n\n`
19
19
  });
20
20
  const titleSlug = title && slug(title.trim());
@@ -21,7 +21,7 @@ function getHref(href) {
21
21
  withBaseHref: href,
22
22
  removeBaseHref: href
23
23
  };
24
- withBaseHref = 'relative' !== linkType || process.env.__SSR__ ? withBase(cleanUrlByConfig(href)) : new URL(href, window.location.href).pathname;
24
+ withBaseHref = 'relative' !== linkType || import.meta.env.SSR ? withBase(cleanUrlByConfig(href)) : new URL(href, window.location.href).pathname;
25
25
  const removeBaseHref = removeBase(withBaseHref);
26
26
  return {
27
27
  withBaseHref,
@@ -39,7 +39,7 @@ function useLinkNavigate({ startTransition } = {
39
39
  if ('external' === linkType || 'hashOnly' === linkType) return void window.location.assign(href);
40
40
  const preloadChunkThenNavigate = async ()=>{
41
41
  const inCurrPage = isActive(removeBaseHref, currPagePathname);
42
- if (!process.env.__SSR__ && !inCurrPage) {
42
+ if (!import.meta.env.SSR && !inCurrPage) {
43
43
  const matchedRoute = pathnameToRouteService(removeBaseHref);
44
44
  if (!matchedRoute) return void window.location.assign(withBaseHref);
45
45
  {
@@ -115,7 +115,7 @@ function Overview(props) {
115
115
  query
116
116
  ]);
117
117
  const overviewTitle = title || 'Overview';
118
- if (process.env.__SSR_MD__) return /*#__PURE__*/ jsxs(Fragment, {
118
+ if (import.meta.env.SSG_MD) return /*#__PURE__*/ jsxs(Fragment, {
119
119
  children: [
120
120
  /*#__PURE__*/ jsx(FallbackHeading, {
121
121
  level: 1,
@@ -34,7 +34,7 @@ function OverviewGroupMarkdown({ group }) {
34
34
  });
35
35
  }
36
36
  const OverviewGroup = ({ group })=>{
37
- if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(OverviewGroupMarkdown, {
37
+ if (import.meta.env.SSG_MD) return /*#__PURE__*/ jsx(OverviewGroupMarkdown, {
38
38
  group: group
39
39
  });
40
40
  const { itemsWithContent, itemsWithoutContent } = useMemo(()=>{
@@ -111,7 +111,7 @@ function PackageManagerTabs({ command, exec, dlx, additionalTabs = [] }) {
111
111
  commandInfo.bun = normalizeCommand(commandInfo.bun);
112
112
  commandInfo.deno = normalizeCommand(commandInfo.deno);
113
113
  } else commandInfo = command;
114
- if (process.env.__SSR_MD__) return Object.values(commandInfo).reduce((previous, current)=>{
114
+ if (import.meta.env.SSG_MD) return Object.values(commandInfo).reduce((previous, current)=>{
115
115
  const [packageManager, command] = splitTo2Parts(current);
116
116
  return previous + `\n\`\`\`sh [${packageManager}]\n` + `${packageManager}${command}\n` + "```\n";
117
117
  }, '');
@@ -1,6 +1,7 @@
1
1
  :root {
2
2
  --rp-steps-gap: 24px;
3
3
  --rp-steps-size: 30px;
4
+ --rp-steps-offset-y: 4px;
4
5
  }
5
6
 
6
7
  .rp-steps {
@@ -13,15 +14,14 @@
13
14
 
14
15
  .rp-steps h3 {
15
16
  counter-increment: step;
16
- align-items: center;
17
- min-height: 30px;
17
+ min-height: var(--rp-steps-size);
18
18
  margin-top: 0;
19
- display: flex;
20
19
  position: relative;
21
20
  }
22
21
 
23
22
  .rp-steps h3:before {
24
23
  content: counter(step);
24
+ top: calc(var(--rp-steps-size)/2 + var(--rp-steps-offset-y));
25
25
  left: calc(-1*var(--rp-steps-gap));
26
26
  width: var(--rp-steps-size);
27
27
  height: var(--rp-steps-size);
@@ -37,11 +37,13 @@
37
37
  font-weight: 500;
38
38
  display: flex;
39
39
  position: absolute;
40
- transform: translate(-50%);
40
+ transform: translate(-50%, -50%);
41
41
  }
42
42
 
43
43
  .rp-steps h3 .rp-header-anchor {
44
+ top: calc(var(--rp-steps-size)/2 + var(--rp-steps-offset-y));
44
45
  left: calc(-1*var(--rp-steps-gap) - var(--rp-steps-size)/2);
45
46
  position: absolute;
47
+ transform: translate(0, -50%);
46
48
  }
47
49
 
@@ -32,7 +32,7 @@ const Tabs = /*#__PURE__*/ forwardRef((props, ref)=>{
32
32
  children,
33
33
  values
34
34
  ]);
35
- if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Fragment, {
35
+ if (import.meta.env.SSG_MD) return /*#__PURE__*/ jsx(Fragment, {
36
36
  children: tabValues.map(({ label, content })=>/*#__PURE__*/ jsxs(Fragment, {
37
37
  children: [
38
38
  `\n**${label}**\n\n`,
@@ -14,7 +14,7 @@ function DocLayout(props) {
14
14
  const isLegacyPlaceholder = 'placeholder' === sidebar;
15
15
  const { outline: showOutline = true, footer: showDocFooter = true, pageType } = frontmatter;
16
16
  const showSidebarMenu = showSidebar || !isOverviewPage && showOutline;
17
- if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Fragment, {
17
+ if (import.meta.env.SSG_MD) return /*#__PURE__*/ jsx(Fragment, {
18
18
  children: isOverviewPage ? /*#__PURE__*/ jsx(Overview, {
19
19
  content: /*#__PURE__*/ jsx(DocContent, {
20
20
  components: components,
@@ -40,7 +40,7 @@ function HomeLayoutMarkdown() {
40
40
  });
41
41
  }
42
42
  function HomeLayout(props) {
43
- if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(HomeLayoutMarkdown, {});
43
+ if (import.meta.env.SSG_MD) return /*#__PURE__*/ jsx(HomeLayoutMarkdown, {});
44
44
  const { beforeHero, afterHero, beforeFeatures, afterFeatures, beforeHeroActions, afterHeroActions } = props;
45
45
  return /*#__PURE__*/ jsxs(Fragment, {
46
46
  children: [
@@ -111,7 +111,7 @@ function Layout(props) {
111
111
  });
112
112
  }
113
113
  };
114
- if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Fragment, {
114
+ if (import.meta.env.SSG_MD) return /*#__PURE__*/ jsx(Fragment, {
115
115
  children: getContentLayout()
116
116
  });
117
117
  useSetup();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
4
4
  "description": "The Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -60,7 +60,7 @@
60
60
  "dependencies": {
61
61
  "@mdx-js/mdx": "^3.1.1",
62
62
  "@mdx-js/react": "^3.1.1",
63
- "@rsbuild/core": "^2.0.6",
63
+ "@rsbuild/core": "^2.0.7",
64
64
  "@rsbuild/plugin-react": "~2.0.0",
65
65
  "@shikijs/rehype": "^4.0.2",
66
66
  "@types/unist": "^3.0.3",
@@ -79,7 +79,7 @@
79
79
  "react-dom": "^19.2.6",
80
80
  "react-lazy-with-preload": "^2.2.1",
81
81
  "react-reconciler": "0.33.0",
82
- "react-render-to-markdown": "19.0.1",
82
+ "react-render-to-markdown": "19.1.0",
83
83
  "react-router-dom": "^7.15.1",
84
84
  "rehype-external-links": "^3.0.0",
85
85
  "rehype-raw": "^7.0.0",
@@ -95,7 +95,7 @@
95
95
  "unist-util-remove": "^4.0.0",
96
96
  "unist-util-visit": "^5.1.0",
97
97
  "unist-util-visit-children": "^3.0.0",
98
- "@rspress/shared": "2.0.12"
98
+ "@rspress/shared": "2.0.13"
99
99
  },
100
100
  "devDependencies": {
101
101
  "@microsoft/api-extractor": "^7.57.7",
@@ -107,7 +107,7 @@
107
107
  "@types/mdast": "^4.0.4",
108
108
  "@types/node": "^22.8.1",
109
109
  "@types/nprogress": "^0.2.3",
110
- "@types/react": "^19.2.14",
110
+ "@types/react": "^19.2.15",
111
111
  "@types/react-dom": "^19.2.3",
112
112
  "@types/react-reconciler": "^0.33.0",
113
113
  "@types/web": "^0.0.349",
@@ -119,7 +119,7 @@
119
119
  "memfs": "^4.57.2",
120
120
  "p-map": "^7.0.4",
121
121
  "picocolors": "^1.1.1",
122
- "postcss": "8.5.14",
122
+ "postcss": "8.5.15",
123
123
  "remark-directive": "^4.0.0",
124
124
  "rsbuild-plugin-publint": "^0.3.4",
125
125
  "rsbuild-plugin-virtual-module": "0.4.2",
@@ -1 +0,0 @@
1
- export {};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes