@rspress/core 1.41.2 → 1.41.3

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.
package/dist/193.js CHANGED
@@ -6,7 +6,7 @@ export const ids = [
6
6
  export const modules = {
7
7
  "./package.json": function(module) {
8
8
  module.exports = {
9
- version: "1.41.2"
9
+ version: "1.41.3"
10
10
  };
11
11
  }
12
12
  };
package/dist/index.js CHANGED
@@ -8,9 +8,11 @@ import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_less_4c557a99__ from "@rsb
8
8
  import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_react_7b149ee4__ from "@rsbuild/plugin-react";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_sass_b13a7d33__ from "@rsbuild/plugin-sass";
10
10
  import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
11
+ import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_constants_70084e62__ from "@rspress/shared/constants";
11
12
  import * as __WEBPACK_EXTERNAL_MODULE_tinyglobby__ from "tinyglobby";
12
13
  import * as __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__ from "node:os";
13
14
  import * as __WEBPACK_EXTERNAL_MODULE_rspack_plugin_virtual_module_609978fd__ from "rspack-plugin-virtual-module";
15
+ import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__ from "@rspress/shared/logger";
14
16
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_es_18c59938__ from "lodash-es";
15
17
  import * as __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__ from "node:crypto";
16
18
  import * as __WEBPACK_EXTERNAL_MODULE__rspress_mdx_rs_d2f3021f__ from "@rspress/mdx-rs";
@@ -19,15 +21,11 @@ import * as __WEBPACK_EXTERNAL_MODULE_html_to_text_2c51ed38__ from "html-to-text
19
21
  import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
20
22
  import * as __WEBPACK_EXTERNAL_MODULE__mdx_js_mdx_b904bd09__ from "@mdx-js/mdx";
21
23
  import * as __WEBPACK_EXTERNAL_MODULE_enhanced_resolve_bf4706da__ from "enhanced-resolve";
24
+ import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
22
25
  import * as __WEBPACK_EXTERNAL_MODULE_picocolors__ from "picocolors";
23
- import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__ from "@rspress/shared/logger";
24
26
  import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__ from "@rsbuild/core";
25
27
  export * from "@rspress/shared";
26
- var __webpack_modules__ = {
27
- "react-syntax-highlighter/dist/cjs/languages/prism/supported-languages": function(module) {
28
- module.exports = require("react-syntax-highlighter/dist/cjs/languages/prism/supported-languages");
29
- }
30
- };
28
+ var __webpack_modules__ = {};
31
29
  var __webpack_module_cache__ = {};
32
30
  function __webpack_require__(moduleId) {
33
31
  var cachedModule = __webpack_module_cache__[moduleId];
@@ -343,6 +341,41 @@ function getPageKey(route) {
343
341
  const cleanRoute = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.removeLeadingSlash)(route);
344
342
  return cleanRoute.replace(/\//g, '_').replace(/\.[^.]+$/, '') || 'index';
345
343
  }
344
+ const normalizeRoutePath = (routePath, base, lang, version, langs, versions, extensions = __WEBPACK_EXTERNAL_MODULE__rspress_shared_constants_70084e62__.DEFAULT_PAGE_EXTENSIONS)=>{
345
+ const hasTrailSlash = routePath.endsWith('/');
346
+ let versionPart = '';
347
+ let langPart = '';
348
+ let purePathPart = '';
349
+ const parts = routePath.split('/').filter(Boolean);
350
+ if (version) {
351
+ const versionToMatch = parts[0];
352
+ if (versions.includes(versionToMatch)) {
353
+ if (versionToMatch !== version) versionPart = versionToMatch;
354
+ parts.shift();
355
+ }
356
+ }
357
+ if (lang) {
358
+ const langToMatch = parts[0];
359
+ if (langs.includes(langToMatch)) {
360
+ if (langToMatch !== lang) langPart = langToMatch;
361
+ parts.shift();
362
+ }
363
+ }
364
+ purePathPart = parts.join('/');
365
+ const extensionsWithoutDot = extensions.map((i)=>i.slice(1));
366
+ const cleanExtensionPattern = new RegExp(`\\.(${extensionsWithoutDot.join('|')})$`, 'i');
367
+ let normalizedRoutePath = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.addLeadingSlash)([
368
+ versionPart,
369
+ langPart,
370
+ purePathPart
371
+ ].filter(Boolean).join('/')).replace(cleanExtensionPattern, '').replace(/\.html$/, '').replace(/\/index$/, '/');
372
+ if (hasTrailSlash) normalizedRoutePath = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.addTrailingSlash)(normalizedRoutePath);
373
+ return {
374
+ routePath: (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.withBase)(normalizedRoutePath, base),
375
+ lang: langPart || lang,
376
+ version: versionPart || version
377
+ };
378
+ };
346
379
  function RouteService_check_private_redeclaration(obj, privateCollection) {
347
380
  if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
348
381
  }
@@ -382,56 +415,17 @@ function _class_private_method_init(obj, privateSet) {
382
415
  RouteService_check_private_redeclaration(obj, privateSet);
383
416
  privateSet.add(obj);
384
417
  }
385
- const DEFAULT_PAGE_EXTENSIONS = [
386
- 'js',
387
- 'jsx',
388
- 'ts',
389
- 'tsx',
390
- 'md',
391
- 'mdx'
392
- ];
393
- const normalizeRoutePath = (routePath, base, lang, version, langs, versions, extensions = DEFAULT_PAGE_EXTENSIONS)=>{
394
- const hasTrailSlash = routePath.endsWith('/');
395
- let versionPart = '';
396
- let langPart = '';
397
- let purePathPart = '';
398
- const parts = routePath.split('/').filter(Boolean);
399
- if (version) {
400
- const versionToMatch = parts[0];
401
- if (versions.includes(versionToMatch)) {
402
- if (versionToMatch !== version) versionPart = versionToMatch;
403
- parts.shift();
404
- }
405
- }
406
- if (lang) {
407
- const langToMatch = parts[0];
408
- if (langs.includes(langToMatch)) {
409
- if (langToMatch !== lang) langPart = langToMatch;
410
- parts.shift();
411
- }
412
- }
413
- purePathPart = parts.join('/');
414
- let normalizedRoutePath = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.addLeadingSlash)([
415
- versionPart,
416
- langPart,
417
- purePathPart
418
- ].filter(Boolean).join('/')).replace(new RegExp(`\\.(${extensions.join('|')})$`), '').replace(/\.html$/, '').replace(/\/index$/, '/');
419
- if (hasTrailSlash) normalizedRoutePath = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.addTrailingSlash)(normalizedRoutePath);
420
- return {
421
- routePath: (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.withBase)(normalizedRoutePath, base),
422
- lang: langPart || lang,
423
- version: versionPart || version
424
- };
425
- };
426
418
  var _scanDir = /*#__PURE__*/ new WeakMap(), _defaultLang = /*#__PURE__*/ new WeakMap(), _defaultVersion = /*#__PURE__*/ new WeakMap(), _extensions = /*#__PURE__*/ new WeakMap(), _langs = /*#__PURE__*/ new WeakMap(), _versions = /*#__PURE__*/ new WeakMap(), _include = /*#__PURE__*/ new WeakMap(), _exclude = /*#__PURE__*/ new WeakMap(), _base = /*#__PURE__*/ new WeakMap(), _tempDir = /*#__PURE__*/ new WeakMap(), _pluginDriver = /*#__PURE__*/ new WeakMap(), _writeTempFile = /*#__PURE__*/ new WeakSet(), _generateRouteInfo = /*#__PURE__*/ new WeakSet();
427
419
  class RouteService {
428
420
  async init() {
421
+ const extensions = RouteService_class_private_field_get(this, _extensions).map((i)=>i.slice(1));
429
422
  const files = (await (0, __WEBPACK_EXTERNAL_MODULE_tinyglobby__.glob)([
430
- `**/*.{${RouteService_class_private_field_get(this, _extensions).join(',')}}`,
423
+ `**/*.{${extensions.join(',')}}`,
431
424
  ...RouteService_class_private_field_get(this, _include)
432
425
  ], {
433
426
  cwd: RouteService_class_private_field_get(this, _scanDir),
434
427
  absolute: true,
428
+ onlyFiles: true,
435
429
  ignore: [
436
430
  ...RouteService_class_private_field_get(this, _exclude),
437
431
  '**/node_modules/**',
@@ -473,8 +467,8 @@ class RouteService {
473
467
  addRoute(routeInfo) {
474
468
  const { routePath, absolutePath } = routeInfo;
475
469
  if (this.routeData.has(routePath)) {
476
- const preRouteExtIndex = RouteService_class_private_field_get(this, _extensions).indexOf(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].extname(this.routeData.get(routePath).absolutePath).slice(1));
477
- const currRouteExtIndex = RouteService_class_private_field_get(this, _extensions).indexOf(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].extname(absolutePath).slice(1));
470
+ const preRouteExtIndex = RouteService_class_private_field_get(this, _extensions).indexOf(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].extname(this.routeData.get(routePath).absolutePath));
471
+ const currRouteExtIndex = RouteService_class_private_field_get(this, _extensions).indexOf(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].extname(absolutePath));
478
472
  if (-1 !== currRouteExtIndex && (currRouteExtIndex < preRouteExtIndex || -1 === preRouteExtIndex)) this.routeData.set(routePath, routeInfo);
479
473
  } else this.routeData.set(routePath, routeInfo);
480
474
  }
@@ -488,7 +482,7 @@ class RouteService {
488
482
  }
489
483
  isExistRoute(routePath) {
490
484
  const { routePath: normalizedRoute } = this.normalizeRoutePath(routePath);
491
- return this.routeData.get(normalizedRoute);
485
+ return Boolean(this.routeData.get(normalizedRoute));
492
486
  }
493
487
  isEmpty() {
494
488
  return 0 === this.routeData.size;
@@ -575,7 +569,7 @@ ${routeMeta.map((route, index)=>{
575
569
  RouteService_class_private_field_set(this, _tempDir, '');
576
570
  const routeOptions = (null == userConfig ? void 0 : userConfig.route) || {};
577
571
  RouteService_class_private_field_set(this, _scanDir, scanDir);
578
- RouteService_class_private_field_set(this, _extensions, routeOptions.extensions || DEFAULT_PAGE_EXTENSIONS);
572
+ RouteService_class_private_field_set(this, _extensions, routeOptions.extensions || __WEBPACK_EXTERNAL_MODULE__rspress_shared_constants_70084e62__.DEFAULT_PAGE_EXTENSIONS);
579
573
  RouteService_class_private_field_set(this, _include, routeOptions.include || []);
580
574
  RouteService_class_private_field_set(this, _exclude, routeOptions.exclude || []);
581
575
  RouteService_class_private_field_set(this, _defaultLang, (null == userConfig ? void 0 : userConfig.lang) || '');
@@ -661,6 +655,7 @@ function getI18nData(docConfig) {
661
655
  const i18nSource = require(i18nSourcePath);
662
656
  return i18nSource;
663
657
  } catch (e) {
658
+ __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.debug('getI18nData Failed: \n', e);
664
659
  return {};
665
660
  }
666
661
  }
@@ -745,6 +740,7 @@ async function flattenMdxContent(content, basePath, alias) {
745
740
  try {
746
741
  ast = processor.parse(content);
747
742
  } catch (e) {
743
+ __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.debug('flattenMdxContent parse failed: \n', e);
748
744
  return {
749
745
  flattenContent: content,
750
746
  deps
@@ -800,7 +796,7 @@ async function extractPageData(replaceRules, alias, domain, root, routeService,
800
796
  frontmatter: {},
801
797
  version: route.version,
802
798
  _filepath: route.absolutePath,
803
- _relativePath: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].relative(root, route.absolutePath)
799
+ _relativePath: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].relative(root, route.absolutePath).split(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].sep).join('/')
804
800
  };
805
801
  if (!__WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.MDX_REGEXP.test(route.absolutePath)) return defaultIndexInfo;
806
802
  let content = await __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__["default"].readFile(route.absolutePath, 'utf8');
@@ -879,12 +875,13 @@ async function extractPageData(replaceRules, alias, domain, root, routeService,
879
875
  }));
880
876
  return pageData.filter(Boolean);
881
877
  }
878
+ const highlightLanguages_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url);
882
879
  let highlightLanguages_supportedLanguages;
883
880
  function handleHighlightLanguages(highlightLanguages, defaultLanguages) {
884
881
  const aliases = {};
885
882
  if (highlightLanguages.size) {
886
883
  if (!highlightLanguages_supportedLanguages) {
887
- const langs = __webpack_require__("react-syntax-highlighter/dist/cjs/languages/prism/supported-languages")["default"];
884
+ const langs = highlightLanguages_require('react-syntax-highlighter/dist/cjs/languages/prism/supported-languages').default;
888
885
  highlightLanguages_supportedLanguages = new Set(langs);
889
886
  }
890
887
  let useDeprecatedTypeWarning = true;
@@ -959,7 +956,7 @@ function normalizeThemeConfig(docConfig, pages = []) {
959
956
  return {
960
957
  text: applyReplaceRules((null == page ? void 0 : page.title) || '', replaceRules),
961
958
  link: normalizedItem,
962
- _fileKey: page._relativePath.replace(/\.mdx?$/, '')
959
+ _fileKey: page._relativePath.replace(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].extname(page._relativePath), '')
963
960
  };
964
961
  }
965
962
  return {
@@ -1206,8 +1203,9 @@ function serveSearchIndexMiddleware(config) {
1206
1203
  if (null === (_req_url = req.url) || void 0 === _req_url ? void 0 : _req_url.includes(searchIndexRequestMatch)) {
1207
1204
  var _req_url1;
1208
1205
  res.setHeader('Content-Type', 'application/json');
1206
+ const outDir = (null == config ? void 0 : config.outDir) ?? (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(process.cwd(), OUTPUT_DIR);
1209
1207
  const searchIndexFile = null === (_req_url1 = req.url) || void 0 === _req_url1 ? void 0 : _req_url1.split('/').pop();
1210
- (0, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.createReadStream)(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(process.cwd(), (null == config ? void 0 : config.outDir) || OUTPUT_DIR, 'static', searchIndexFile), 'utf-8').pipe(res, {
1208
+ (0, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.createReadStream)((0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(outDir, 'static', searchIndexFile), 'utf-8').pipe(res, {
1211
1209
  end: true
1212
1210
  });
1213
1211
  } else null == next || next();
@@ -1273,8 +1271,7 @@ async function resolveReactAlias(reactVersion, isSSR) {
1273
1271
  });
1274
1272
  });
1275
1273
  } catch (e) {
1276
- console.log(e);
1277
- __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.warn(`${lib} not found`);
1274
+ __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.warn(`${lib} not found: \n`, e);
1278
1275
  }
1279
1276
  }));
1280
1277
  return alias;
@@ -1597,6 +1594,7 @@ async function collectModuleFiles(contentPath, lang, includedDir, excludedDirs,
1597
1594
  fileLangMap[baseName].add(lang);
1598
1595
  }
1599
1596
  } catch (e) {
1597
+ __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.error(e);
1600
1598
  throw new Error(`Failed to access directory: ${checkLanguageParity_normalizePath(langModuleDir)}`);
1601
1599
  }
1602
1600
  return fileLangMap;
@@ -1632,7 +1630,7 @@ async function checkLanguageParity(config) {
1632
1630
  if (missingLanguagesFile.length > 0) throw new Error(`Check language parity failed! Missing content:\n${missingLanguagesFile.map((file)=>` - ${checkLanguageParity_normalizePath(file)}`).join('\n')}`);
1633
1631
  __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.success('Language parity checked successfully.');
1634
1632
  } catch (err) {
1635
- __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.error(`Error during language parity check: ${err.message}`);
1633
+ __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.error('Error during language parity check: \n', err);
1636
1634
  throw err;
1637
1635
  }
1638
1636
  }
@@ -1753,7 +1751,7 @@ async function renderPages(appDirectory, config, pluginDriver, ssgConfig) {
1753
1751
  __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.error(`Page "${__WEBPACK_EXTERNAL_MODULE_picocolors__["default"].yellow(routePath)}" SSG rendering failed.`);
1754
1752
  throw e;
1755
1753
  }
1756
- __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.warn(`Page "${__WEBPACK_EXTERNAL_MODULE_picocolors__["default"].yellow(routePath)}" SSG rendering error: ${e.message}, fallback to CSR.`);
1754
+ __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.warn(`Page "${__WEBPACK_EXTERNAL_MODULE_picocolors__["default"].yellow(routePath)}" SSG rendering error, fallback to CSR.`, e);
1757
1755
  }
1758
1756
  const { helmet } = helmetContext.context;
1759
1757
  let html = htmlTemplate.replace(/<title>(.*?)<\/title>/gi, '').replace(APP_HTML_MARKER, ()=>appHtml).replace(META_GENERATOR, ()=>`<meta name="generator" content="Rspress v${version}">`).replace(HEAD_MARKER, [
package/dist/loader.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { DefaultThemeConfig } from '@rspress/shared';
2
2
  import type { PageIndexInfo } from '@rspress/shared';
3
- import { RouteMeta } from '@rspress/shared';
3
+ import type { RouteMeta } from '@rspress/shared';
4
4
  import type { Rspack as Rspack_2 } from '@rsbuild/core';
5
5
  import type { RspressPlugin } from '@rspress/shared';
6
- import { UserConfig } from '@rspress/shared';
6
+ import type { UserConfig } from '@rspress/shared';
7
7
 
8
8
  export declare function createCheckPageMetaUpdateFn(): (modulePath: string, pageMeta: PageMeta) => void;
9
9
 
@@ -56,7 +56,7 @@ declare class RouteService {
56
56
  addRoute(routeInfo: RouteMeta): void;
57
57
  removeRoute(filePath: string): void;
58
58
  getRoutes(): RouteMeta[];
59
- isExistRoute(routePath: string): RouteMeta;
59
+ isExistRoute(routePath: string): boolean;
60
60
  isEmpty(): boolean;
61
61
  generateRoutesCode(isStaticImport?: boolean): string;
62
62
  generateRoutesCodeByRouteMeta(routeMeta: RouteMeta[], isStaticImport: boolean): string;
package/dist/loader.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import __rslib_shim_module__ from 'module';
2
- const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
2
+ /*#__PURE__*/ import.meta.url;
3
3
  import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__ from "node:fs/promises";
4
4
  import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
@@ -17,21 +17,6 @@ import * as __WEBPACK_EXTERNAL_MODULE_unist_util_visit_555e002a__ from "unist-ut
17
17
  import * as __WEBPACK_EXTERNAL_MODULE_github_slugger_8e9a17cb__ from "github-slugger";
18
18
  import * as __WEBPACK_EXTERNAL_MODULE_hast_util_heading_rank_cff646ba__ from "hast-util-heading-rank";
19
19
  import * as __WEBPACK_EXTERNAL_MODULE_unist_util_visit_children_71921007__ from "unist-util-visit-children";
20
- var __webpack_modules__ = {
21
- "@rspress/mdx-rs": function(module) {
22
- module.exports = require("@rspress/mdx-rs");
23
- }
24
- };
25
- var __webpack_module_cache__ = {};
26
- function __webpack_require__(moduleId) {
27
- var cachedModule = __webpack_module_cache__[moduleId];
28
- if (void 0 !== cachedModule) return cachedModule.exports;
29
- var module = __webpack_module_cache__[moduleId] = {
30
- exports: {}
31
- };
32
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
33
- return module.exports;
34
- }
35
20
  const importStatementRegex = /import\s+(.*?)\s+from\s+(['"])(.*?)(?:"|');?/gm;
36
21
  `{
37
22
  const saved = localStorage.getItem('${__WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.APPEARANCE_KEY}')
@@ -105,6 +90,7 @@ async function flattenMdxContent(content, basePath, alias) {
105
90
  try {
106
91
  ast = processor.parse(content);
107
92
  } catch (e) {
93
+ __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.debug('flattenMdxContent parse failed: \n', e);
108
94
  return {
109
95
  flattenContent: content,
110
96
  deps
@@ -391,6 +377,14 @@ const parseToc = (tree)=>{
391
377
  var _child_children1;
392
378
  return `**${null === (_child_children1 = child.children) || void 0 === _child_children1 ? void 0 : _child_children1.map((item)=>item.value).join('')}**`;
393
379
  }
380
+ if ('emphasis' === child.type) {
381
+ var _child_children2;
382
+ return `*${null === (_child_children2 = child.children) || void 0 === _child_children2 ? void 0 : _child_children2.map((item)=>item.value).join('')}*`;
383
+ }
384
+ if ('delete' === child.type) {
385
+ var _child_children3;
386
+ return `~~${null === (_child_children3 = child.children) || void 0 === _child_children3 ? void 0 : _child_children3.map((item)=>item.value).join('')}~~`;
387
+ }
394
388
  if ('text' === child.type) {
395
389
  const [textPart, idPart] = extractTextAndId(child.value);
396
390
  customId = idPart;
@@ -542,7 +536,7 @@ async function mdxLoader(source) {
542
536
  toc: []
543
537
  };
544
538
  if (enableMdxRs) {
545
- const { compile } = __webpack_require__("@rspress/mdx-rs");
539
+ const { compile } = await import("@rspress/mdx-rs");
546
540
  const { toc, links, title, code } = await compile({
547
541
  value: preprocessedContent,
548
542
  filepath,
@@ -587,6 +581,7 @@ MDXContent.__RSPRESS_PAGE_META["${encodeURIComponent(normalizePath(__WEBPACK_EXT
587
581
  callback(null, result);
588
582
  } catch (e) {
589
583
  __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.error(`MDX compile error: ${e.message} in ${filepath}`);
584
+ __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.debug(e);
590
585
  callback({
591
586
  message: e.message,
592
587
  name: `${filepath} compile error`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "1.41.2",
3
+ "version": "1.41.3",
4
4
  "description": "The Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -78,13 +78,13 @@
78
78
  "unified": "^10.1.2",
79
79
  "unist-util-visit": "^4.1.2",
80
80
  "unist-util-visit-children": "^3.0.0",
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"
81
+ "@rspress/plugin-auto-nav-sidebar": "1.41.3",
82
+ "@rspress/plugin-container-syntax": "1.41.3",
83
+ "@rspress/plugin-medium-zoom": "1.41.3",
84
+ "@rspress/runtime": "1.41.3",
85
+ "@rspress/plugin-last-updated": "1.41.3",
86
+ "@rspress/shared": "1.41.3",
87
+ "@rspress/theme-default": "1.41.3"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@microsoft/api-extractor": "^7.49.2",