@rspress/core 1.5.0 → 1.6.0

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/loader.js CHANGED
@@ -3608,6 +3608,34 @@ function normalizePath(id) {
3608
3608
  return path.posix.normalize(isWindows ? slash(id) : id);
3609
3609
  }
3610
3610
 
3611
+ // src/node/utils/getASTNodeImport.ts
3612
+ var getASTNodeImport = (name, from) => ({
3613
+ type: "mdxjsEsm",
3614
+ value: `import ${name} from ${JSON.stringify(from)}`,
3615
+ data: {
3616
+ estree: {
3617
+ type: "Program",
3618
+ sourceType: "module",
3619
+ body: [
3620
+ {
3621
+ type: "ImportDeclaration",
3622
+ specifiers: [
3623
+ {
3624
+ type: "ImportDefaultSpecifier",
3625
+ local: { type: "Identifier", name }
3626
+ }
3627
+ ],
3628
+ source: {
3629
+ type: "Literal",
3630
+ value: from,
3631
+ raw: `${JSON.stringify(from)}`
3632
+ }
3633
+ }
3634
+ ]
3635
+ }
3636
+ }
3637
+ });
3638
+
3611
3639
  // src/node/utils/loadFrontMatter.ts
3612
3640
  var import_gray_matter = __toESM(require_gray_matter());
3613
3641
  import path2 from "path";
@@ -3698,36 +3726,6 @@ var rehypePluginCodeMeta = () => {
3698
3726
  import path3 from "path";
3699
3727
  import { visit as visit2 } from "unist-util-visit";
3700
3728
  import { normalizeHref, parseUrl, isExternalUrl, slash as slash2 } from "@rspress/shared";
3701
-
3702
- // src/node/utils/getASTNodeImport.ts
3703
- var getASTNodeImport = (name, from) => ({
3704
- type: "mdxjsEsm",
3705
- value: `import ${name} from ${JSON.stringify(from)}`,
3706
- data: {
3707
- estree: {
3708
- type: "Program",
3709
- sourceType: "module",
3710
- body: [
3711
- {
3712
- type: "ImportDeclaration",
3713
- specifiers: [
3714
- {
3715
- type: "ImportDefaultSpecifier",
3716
- local: { type: "Identifier", name }
3717
- }
3718
- ],
3719
- source: {
3720
- type: "Literal",
3721
- value: from,
3722
- raw: `${JSON.stringify(from)}`
3723
- }
3724
- }
3725
- ]
3726
- }
3727
- }
3728
- });
3729
-
3730
- // src/node/mdx/remarkPlugins/normalizeLink.ts
3731
3729
  var remarkPluginNormalizeLink = ({ base, root, cleanUrls }) => (tree, file) => {
3732
3730
  const images = [];
3733
3731
  visit2(