@rspress/core 1.41.1 → 1.41.2

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.
@@ -1,139 +1,113 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import {
3
- DataContext,
4
- isEqualPath,
5
- matchRoutes,
6
- normalizeRoutePath,
7
- useLocation
8
- } from "@rspress/runtime";
9
- import {
10
- MDX_REGEXP,
11
- cleanUrl
12
- } from "@rspress/shared";
13
- import Theme from "@theme";
14
- import React, { useContext, useLayoutEffect } from "react";
15
- import { HelmetProvider } from "react-helmet-async";
16
- import globalComponents from "virtual-global-components";
17
- import siteData from "virtual-site-data";
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__ from "@rspress/runtime";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__ from "@rspress/shared";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__theme_75e53063__ from "@theme";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_react_helmet_async_048d06c6__ from "react-helmet-async";
7
+ import * as __WEBPACK_EXTERNAL_MODULE_virtual_global_components_43dbb356__ from "virtual-global-components";
8
+ import * as __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__ from "virtual-site-data";
18
9
  import "virtual-global-styles";
19
- var QueryStatus = /* @__PURE__ */ ((QueryStatus2) => {
20
- QueryStatus2["Show"] = "1";
21
- QueryStatus2["Hide"] = "0";
22
- return QueryStatus2;
23
- })(QueryStatus || {});
10
+ var App_rslib_entry_QueryStatus = /*#__PURE__*/ function(QueryStatus) {
11
+ QueryStatus["Show"] = "1";
12
+ QueryStatus["Hide"] = "0";
13
+ return QueryStatus;
14
+ }({});
24
15
  async function initPageData(routePath) {
25
- const { routes } = process.env.__SSR__ ? require("virtual-routes-ssr") : require("virtual-routes");
26
- const matched = matchRoutes(routes, routePath);
27
- if (matched) {
28
- const matchedRoute = matched[0].route;
29
- const mod = await matchedRoute.preload();
30
- const pagePath = cleanUrl(matched[0].route.filePath);
31
- const extractPageInfo = siteData.pages.find((page) => {
32
- const normalize = (p) => (
33
- // compat the path that has no / suffix and ignore case
34
- p.replace(/\/$/, "").toLowerCase()
35
- );
36
- return isEqualPath(normalize(page.routePath), normalize(routePath));
37
- });
38
- const encodedPagePath = encodeURIComponent(pagePath);
39
- const meta = mod.default.__RSPRESS_PAGE_META?.[encodedPagePath] || {};
40
- const {
41
- toc = [],
42
- title = "",
43
- frontmatter = {},
44
- ...rest
45
- } = MDX_REGEXP.test(matchedRoute.filePath) ? meta : mod;
46
- return {
47
- siteData,
48
- page: {
49
- ...rest,
50
- pagePath,
51
- ...extractPageInfo,
52
- pageType: frontmatter?.pageType || "doc",
53
- title,
54
- frontmatter,
55
- toc
56
- }
57
- };
58
- }
59
- let lang = siteData.lang || "";
60
- let version = siteData.multiVersion?.default || "";
61
- if (siteData.lang && typeof window !== "undefined") {
62
- const path = location.pathname.replace(siteData.base, "").split("/").slice(0, 2);
63
- if (siteData.locales.length) {
64
- const result = siteData.locales.find(({ lang: lang2 }) => path.includes(lang2));
65
- if (result) {
66
- lang = result.lang;
67
- }
68
- }
69
- if (siteData.multiVersion.versions) {
70
- const result = siteData.multiVersion.versions.find(
71
- (version2) => path.includes(version2)
72
- );
73
- if (result) {
74
- version = result;
75
- }
16
+ var _siteData_multiVersion;
17
+ const { routes } = process.env.__SSR__ ? await import("virtual-routes-ssr") : await import("virtual-routes");
18
+ const matched = (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.matchRoutes)(routes, routePath);
19
+ if (matched) {
20
+ var _mod_default___RSPRESS_PAGE_META;
21
+ const matchedRoute = matched[0].route;
22
+ const mod = await matchedRoute.preload();
23
+ const pagePath = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.cleanUrl)(matched[0].route.filePath);
24
+ const extractPageInfo = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].pages.find((page)=>{
25
+ const normalize = (p)=>p.replace(/\/$/, '').toLowerCase();
26
+ return (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.isEqualPath)(normalize(page.routePath), normalize(routePath));
27
+ });
28
+ const encodedPagePath = encodeURIComponent(pagePath);
29
+ const meta = (null === (_mod_default___RSPRESS_PAGE_META = mod.default.__RSPRESS_PAGE_META) || void 0 === _mod_default___RSPRESS_PAGE_META ? void 0 : _mod_default___RSPRESS_PAGE_META[encodedPagePath]) || {};
30
+ const { toc = [], title = '', frontmatter = {}, ...rest } = __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.MDX_REGEXP.test(matchedRoute.filePath) ? meta : mod;
31
+ return {
32
+ siteData: __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"],
33
+ page: {
34
+ ...rest,
35
+ pagePath,
36
+ ...extractPageInfo,
37
+ pageType: (null == frontmatter ? void 0 : frontmatter.pageType) || 'doc',
38
+ title,
39
+ frontmatter,
40
+ toc
41
+ }
42
+ };
76
43
  }
77
- }
78
- return {
79
- siteData,
80
- page: {
81
- pagePath: "",
82
- pageType: "404",
83
- routePath: "/404",
84
- lang,
85
- frontmatter: {},
86
- title: "404",
87
- toc: [],
88
- version,
89
- _filepath: "",
90
- _relativePath: ""
44
+ let lang = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].lang || '';
45
+ let version = (null === (_siteData_multiVersion = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].multiVersion) || void 0 === _siteData_multiVersion ? void 0 : _siteData_multiVersion.default) || '';
46
+ if (__WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].lang && 'undefined' != typeof window) {
47
+ const path = location.pathname.replace(__WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].base, '').split('/').slice(0, 2);
48
+ if (__WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].locales.length) {
49
+ const result = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].locales.find(({ lang })=>path.includes(lang));
50
+ if (result) lang = result.lang;
51
+ }
52
+ if (__WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].multiVersion.versions) {
53
+ const result = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].multiVersion.versions.find((version)=>path.includes(version));
54
+ if (result) version = result;
55
+ }
91
56
  }
92
- };
57
+ return {
58
+ siteData: __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"],
59
+ page: {
60
+ pagePath: '',
61
+ pageType: '404',
62
+ routePath: '/404',
63
+ lang,
64
+ frontmatter: {},
65
+ title: '404',
66
+ toc: [],
67
+ version,
68
+ _filepath: '',
69
+ _relativePath: ''
70
+ }
71
+ };
93
72
  }
94
73
  function App({ helmetContext }) {
95
- const { setData: setPageData, data } = useContext(DataContext);
96
- const frontmatter = data.page.frontmatter || {};
97
- const { pathname, search } = useLocation();
98
- const query = new URLSearchParams(search);
99
- const GLOBAL_COMPONENTS_KEY = "globalUIComponents";
100
- const hideGlobalUIComponents = (
101
- // Disable global components in frontmatter or query
102
- frontmatter[GLOBAL_COMPONENTS_KEY] === false || query.get(GLOBAL_COMPONENTS_KEY) === "0" /* Hide */
103
- );
104
- useLayoutEffect(() => {
105
- async function refetchData() {
106
- try {
107
- const pageData = await initPageData(normalizeRoutePath(pathname));
108
- setPageData(pageData);
109
- } catch (e) {
110
- console.log(e);
111
- }
112
- }
113
- refetchData();
114
- }, [pathname, setPageData]);
115
- return /* @__PURE__ */ jsxs(HelmetProvider, { context: helmetContext, children: [
116
- /* @__PURE__ */ jsx(Theme.Layout, {}),
117
- // Global UI
118
- !hideGlobalUIComponents && globalComponents.map((componentInfo, index) => {
119
- if (Array.isArray(componentInfo)) {
120
- const [component, props] = componentInfo;
121
- return React.createElement(component, {
122
- // The component order is stable
123
- // eslint-disable-next-line react/no-array-index-key
124
- key: index,
125
- ...props
126
- });
127
- }
128
- return React.createElement(componentInfo, {
129
- // eslint-disable-next-line react/no-array-index-key
130
- key: index
131
- });
132
- })
133
- ] });
74
+ const { setData: setPageData, data } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.DataContext);
75
+ const frontmatter = data.page.frontmatter || {};
76
+ const { pathname, search } = (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.useLocation)();
77
+ const query = new URLSearchParams(search);
78
+ const GLOBAL_COMPONENTS_KEY = 'globalUIComponents';
79
+ const hideGlobalUIComponents = false === frontmatter[GLOBAL_COMPONENTS_KEY] || "0" === query.get(GLOBAL_COMPONENTS_KEY);
80
+ (0, __WEBPACK_EXTERNAL_MODULE_react__.useLayoutEffect)(()=>{
81
+ async function refetchData() {
82
+ try {
83
+ const pageData = await initPageData((0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.normalizeRoutePath)(pathname));
84
+ setPageData(pageData);
85
+ } catch (e) {
86
+ console.log(e);
87
+ }
88
+ }
89
+ refetchData();
90
+ }, [
91
+ pathname,
92
+ setPageData
93
+ ]);
94
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_helmet_async_048d06c6__.HelmetProvider, {
95
+ context: helmetContext,
96
+ children: [
97
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__theme_75e53063__["default"].Layout, {}),
98
+ !hideGlobalUIComponents && __WEBPACK_EXTERNAL_MODULE_virtual_global_components_43dbb356__["default"].map((componentInfo, index)=>{
99
+ if (Array.isArray(componentInfo)) {
100
+ const [component, props] = componentInfo;
101
+ return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(component, {
102
+ key: index,
103
+ ...props
104
+ });
105
+ }
106
+ return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(componentInfo, {
107
+ key: index
108
+ });
109
+ })
110
+ ]
111
+ });
134
112
  }
135
- export {
136
- App,
137
- QueryStatus,
138
- initPageData
139
- };
113
+ export { App, App_rslib_entry_QueryStatus as QueryStatus, initPageData };
@@ -1,60 +1,77 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import {
3
- BrowserRouter,
4
- DataContext,
5
- ThemeContext,
6
- normalizeRoutePath
7
- } from "@rspress/runtime";
8
- import { isProduction } from "@rspress/shared";
9
- import { useMemo, useState } from "react";
10
- import siteData from "virtual-site-data";
11
- import { App, initPageData } from "./App";
12
- const enableSSG = siteData.ssg;
13
- const { default: Theme, useThemeState } = require("@theme");
1
+ import * as __WEBPACK_EXTERNAL_MODULE__theme_75e53063__ from "@theme";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_react_dom_7136dc57__ from "react-dom";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_react_dom_client_76b1397c__ from "react-dom/client";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__ from "@rspress/runtime";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__ from "@rspress/shared";
7
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
8
+ import * as __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__ from "virtual-site-data";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__ from "./App.js";
10
+ var __webpack_modules__ = {
11
+ "@theme": function(module) {
12
+ module.exports = __WEBPACK_EXTERNAL_MODULE__theme_75e53063__;
13
+ },
14
+ "react-dom": function(module) {
15
+ module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom_7136dc57__;
16
+ },
17
+ "react-dom/client": function(module) {
18
+ module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom_client_76b1397c__;
19
+ }
20
+ };
21
+ var __webpack_module_cache__ = {};
22
+ function __webpack_require__(moduleId) {
23
+ var cachedModule = __webpack_module_cache__[moduleId];
24
+ if (void 0 !== cachedModule) return cachedModule.exports;
25
+ var module = __webpack_module_cache__[moduleId] = {
26
+ exports: {}
27
+ };
28
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
29
+ return module.exports;
30
+ }
31
+ const enableSSG = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].ssg;
32
+ const { default: Theme, useThemeState } = __webpack_require__("@theme");
14
33
  async function renderInBrowser() {
15
- const container = document.getElementById("root");
16
- const enhancedApp = async () => {
17
- const initialPageData = await initPageData(
18
- normalizeRoutePath(window.location.pathname)
19
- );
20
- return function RootApp2() {
21
- const [data, setData] = useState(initialPageData);
22
- const [theme, setTheme] = useThemeState();
23
- return /* @__PURE__ */ jsx(
24
- ThemeContext.Provider,
25
- {
26
- value: useMemo(() => ({ theme, setTheme }), [theme, setTheme]),
27
- children: /* @__PURE__ */ jsx(
28
- DataContext.Provider,
29
- {
30
- value: useMemo(() => ({ data, setData }), [data, setData]),
31
- children: /* @__PURE__ */ jsx(BrowserRouter, { children: /* @__PURE__ */ jsx(App, {}) })
32
- }
33
- )
34
- }
35
- );
34
+ const container = document.getElementById('root');
35
+ const enhancedApp = async ()=>{
36
+ const initialPageData = await (0, __WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__.initPageData)((0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.normalizeRoutePath)(window.location.pathname));
37
+ return function() {
38
+ const [data, setData] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(initialPageData);
39
+ const [theme, setTheme] = useThemeState();
40
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.ThemeContext.Provider, {
41
+ value: (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
42
+ theme,
43
+ setTheme
44
+ }), [
45
+ theme,
46
+ setTheme
47
+ ]),
48
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.DataContext.Provider, {
49
+ value: (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
50
+ data,
51
+ setData
52
+ }), [
53
+ data,
54
+ setData
55
+ ]),
56
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.BrowserRouter, {
57
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__.App, {})
58
+ })
59
+ })
60
+ });
61
+ };
36
62
  };
37
- };
38
- const RootApp = await enhancedApp();
39
- if (process.env.__REACT_GTE_18__) {
40
- const { createRoot, hydrateRoot } = require("react-dom/client");
41
- if (isProduction() && enableSSG) {
42
- hydrateRoot(container, /* @__PURE__ */ jsx(RootApp, {}));
63
+ const RootApp = await enhancedApp();
64
+ if (process.env.__REACT_GTE_18__) {
65
+ const { createRoot, hydrateRoot } = __webpack_require__("react-dom/client");
66
+ if ((0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.isProduction)() && enableSSG) hydrateRoot(container, /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(RootApp, {}));
67
+ else createRoot(container).render(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(RootApp, {}));
43
68
  } else {
44
- createRoot(container).render(/* @__PURE__ */ jsx(RootApp, {}));
69
+ const ReactDOM = __webpack_require__("react-dom");
70
+ if ((0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.isProduction)()) ReactDOM.hydrate(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(RootApp, {}), container);
71
+ else ReactDOM.render(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(RootApp, {}), container);
45
72
  }
46
- } else {
47
- const ReactDOM = require("react-dom");
48
- if (isProduction()) {
49
- ReactDOM.hydrate(/* @__PURE__ */ jsx(RootApp, {}), container);
50
- } else {
51
- ReactDOM.render(/* @__PURE__ */ jsx(RootApp, {}), container);
52
- }
53
- }
54
73
  }
55
- renderInBrowser().then(() => {
56
- Theme.setup();
74
+ renderInBrowser().then(()=>{
75
+ Theme.setup();
57
76
  });
58
- export {
59
- renderInBrowser
60
- };
77
+ export { renderInBrowser };
@@ -1,21 +1,32 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { DataContext, ThemeContext } from "@rspress/runtime";
3
- import { StaticRouter } from "@rspress/runtime/server";
4
- import { renderToString } from "react-dom/server";
5
- import { App, initPageData } from "./App";
6
- const DEFAULT_THEME = "light";
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__ from "@rspress/runtime";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_server_673c713a__ from "@rspress/runtime/server";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_react_dom_server_98c38d5c__ from "react-dom/server";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__ from "./App.js";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_virtual_routes_ssr_f802e6e5__ from "virtual-routes-ssr";
7
+ const DEFAULT_THEME = 'light';
7
8
  async function render(pagePath, helmetContext) {
8
- const initialPageData = await initPageData(pagePath);
9
- const appHtml = renderToString(
10
- /* @__PURE__ */ jsx(ThemeContext.Provider, { value: { theme: DEFAULT_THEME }, children: /* @__PURE__ */ jsx(DataContext.Provider, { value: { data: initialPageData }, children: /* @__PURE__ */ jsx(StaticRouter, { location: pagePath, children: /* @__PURE__ */ jsx(App, { helmetContext }) }) }) })
11
- );
12
- return {
13
- appHtml,
14
- pageData: initialPageData
15
- };
9
+ const initialPageData = await (0, __WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__.initPageData)(pagePath);
10
+ const appHtml = (0, __WEBPACK_EXTERNAL_MODULE_react_dom_server_98c38d5c__.renderToString)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.ThemeContext.Provider, {
11
+ value: {
12
+ theme: DEFAULT_THEME
13
+ },
14
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.DataContext.Provider, {
15
+ value: {
16
+ data: initialPageData
17
+ },
18
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_server_673c713a__.StaticRouter, {
19
+ location: pagePath,
20
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__.App, {
21
+ helmetContext: helmetContext
22
+ })
23
+ })
24
+ })
25
+ }));
26
+ return {
27
+ appHtml,
28
+ pageData: initialPageData
29
+ };
16
30
  }
17
- import { routes } from "virtual-routes-ssr";
18
- export {
19
- render,
20
- routes
21
- };
31
+ var __webpack_exports__routes = __WEBPACK_EXTERNAL_MODULE_virtual_routes_ssr_f802e6e5__.routes;
32
+ export { render, __webpack_exports__routes as routes };
@@ -0,0 +1,4 @@
1
+ var tsconfig_rslib_entry_namespaceObject = JSON.parse('{"compilerOptions":{"rootDir":".","baseUrl":".","skipLibCheck":true,"jsx":"react-jsx","esModuleInterop":true},"include":["./**/*"]}');
2
+ var __webpack_exports__compilerOptions = tsconfig_rslib_entry_namespaceObject.compilerOptions;
3
+ var __webpack_exports__include = tsconfig_rslib_entry_namespaceObject.include;
4
+ export { __webpack_exports__compilerOptions as compilerOptions, __webpack_exports__include as include };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "1.41.1",
3
+ "version": "1.41.2",
4
4
  "description": "The Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -64,6 +64,7 @@
64
64
  "lodash-es": "^4.17.21",
65
65
  "mdast-util-mdxjs-esm": "^1.3.1",
66
66
  "memfs": "^4.17.0",
67
+ "picocolors": "^1.1.1",
67
68
  "react": "^18.3.1",
68
69
  "react-dom": "^18.3.1",
69
70
  "react-helmet-async": "^1.3.0",
@@ -77,17 +78,18 @@
77
78
  "unified": "^10.1.2",
78
79
  "unist-util-visit": "^4.1.2",
79
80
  "unist-util-visit-children": "^3.0.0",
80
- "@rspress/plugin-container-syntax": "1.41.1",
81
- "@rspress/plugin-auto-nav-sidebar": "1.41.1",
82
- "@rspress/plugin-last-updated": "1.41.1",
83
- "@rspress/runtime": "1.41.1",
84
- "@rspress/shared": "1.41.1",
85
- "@rspress/theme-default": "1.41.1",
86
- "@rspress/plugin-medium-zoom": "1.41.1"
81
+ "@rspress/plugin-auto-nav-sidebar": "1.41.2",
82
+ "@rspress/plugin-container-syntax": "1.41.2",
83
+ "@rspress/plugin-last-updated": "1.41.2",
84
+ "@rspress/runtime": "1.41.2",
85
+ "@rspress/plugin-medium-zoom": "1.41.2",
86
+ "@rspress/theme-default": "1.41.2",
87
+ "@rspress/shared": "1.41.2"
87
88
  },
88
89
  "devDependencies": {
89
- "@modern-js/plugin-tailwindcss": "2.64.0",
90
+ "@microsoft/api-extractor": "^7.49.2",
90
91
  "@modern-js/tsconfig": "2.64.0",
92
+ "@rslib/core": "0.4.1",
91
93
  "@types/hast": "3.0.4",
92
94
  "@types/html-to-text": "^9.0.4",
93
95
  "@types/jest": "~29.5.14",
@@ -102,8 +104,7 @@
102
104
  "remark-rehype": "^10.1.0",
103
105
  "rimraf": "^3.0.2",
104
106
  "tailwindcss": "^3.4.17",
105
- "typescript": "^5.5.3",
106
- "vitest": "2.1.9"
107
+ "typescript": "^5.5.3"
107
108
  },
108
109
  "engines": {
109
110
  "node": ">=14.17.6"
@@ -115,9 +116,8 @@
115
116
  },
116
117
  "jsnext:source": "./src/index.ts",
117
118
  "scripts": {
118
- "build": "modern build",
119
- "dev": "modern build -w",
120
- "reset": "rimraf ./**/node_modules",
121
- "test": "vitest run --passWithNoTests"
119
+ "build": "rslib build",
120
+ "dev": "rslib build -w",
121
+ "reset": "rimraf ./**/node_modules"
122
122
  }
123
123
  }
@@ -32,8 +32,11 @@ type PageMeta = {
32
32
 
33
33
  export async function initPageData(routePath: string): Promise<PageData> {
34
34
  const { routes } = process.env.__SSR__
35
- ? (require('virtual-routes-ssr') as typeof import('virtual-routes-ssr'))
36
- : (require('virtual-routes') as typeof import('virtual-routes'));
35
+ ? // biome-ignore format: Biome format will add an extra comma.
36
+ ((await import('virtual-routes-ssr')) as typeof import(
37
+ 'virtual-routes-ssr'
38
+ ))
39
+ : ((await import('virtual-routes')) as typeof import('virtual-routes'));
37
40
  const matched = matchRoutes(routes, routePath)!;
38
41
  if (matched) {
39
42
  // Preload route component