fumadocs-mdx 14.2.2 → 14.2.4

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 (116) hide show
  1. package/dist/adapter-DG-viEbG.js +144 -0
  2. package/dist/adapter-DG-viEbG.js.map +1 -0
  3. package/dist/bin.d.ts +1 -1
  4. package/dist/bin.js +21 -12
  5. package/dist/bin.js.map +1 -0
  6. package/dist/build-BTTNEFmV.js +100 -0
  7. package/dist/build-BTTNEFmV.js.map +1 -0
  8. package/dist/build-mdx-10MrLupc.d.ts +53 -0
  9. package/dist/build-mdx-10MrLupc.d.ts.map +1 -0
  10. package/dist/build-mdx-BVeBo4jT.js +153 -0
  11. package/dist/build-mdx-BVeBo4jT.js.map +1 -0
  12. package/dist/build-mdx-ChjP7zAn.js +5 -0
  13. package/dist/bun/index.d.ts +10 -21
  14. package/dist/bun/index.d.ts.map +1 -0
  15. package/dist/bun/index.js +30 -49
  16. package/dist/bun/index.js.map +1 -0
  17. package/dist/codegen-DleOVLNr.js +101 -0
  18. package/dist/codegen-DleOVLNr.js.map +1 -0
  19. package/dist/config/index.d.ts +2 -18
  20. package/dist/config/index.js +50 -53
  21. package/dist/config/index.js.map +1 -0
  22. package/dist/core-DG43f_AU.d.ts +364 -0
  23. package/dist/core-DG43f_AU.d.ts.map +1 -0
  24. package/dist/core-DjldE3H9.js +212 -0
  25. package/dist/core-DjldE3H9.js.map +1 -0
  26. package/dist/fuma-matter-CHgJa_-B.js +27 -0
  27. package/dist/fuma-matter-CHgJa_-B.js.map +1 -0
  28. package/dist/index-Bc_4I1HE.d.ts +12 -0
  29. package/dist/index-Bc_4I1HE.d.ts.map +1 -0
  30. package/dist/index-file-D9HsrWU_.js +264 -0
  31. package/dist/index-file-D9HsrWU_.js.map +1 -0
  32. package/dist/index.d.ts +3 -61
  33. package/dist/index.js +1 -0
  34. package/dist/load-from-file-B7Rswy9i.js +5 -0
  35. package/dist/load-from-file-Doc98oEB.js +38 -0
  36. package/dist/load-from-file-Doc98oEB.js.map +1 -0
  37. package/dist/loaders-BVwYfelL.js +7 -0
  38. package/dist/loaders-BVwYfelL.js.map +1 -0
  39. package/dist/mdx-DMZ9tsAa.js +91 -0
  40. package/dist/mdx-DMZ9tsAa.js.map +1 -0
  41. package/dist/meta-DyieTM4Z.js +81 -0
  42. package/dist/meta-DyieTM4Z.js.map +1 -0
  43. package/dist/next/index.cjs +863 -1076
  44. package/dist/next/index.d.ts +17 -28
  45. package/dist/next/index.d.ts.map +1 -0
  46. package/dist/next/index.js +141 -170
  47. package/dist/next/index.js.map +1 -0
  48. package/dist/node/loader.d.ts +4 -2
  49. package/dist/node/loader.d.ts.map +1 -0
  50. package/dist/node/loader.js +26 -38
  51. package/dist/node/loader.js.map +1 -0
  52. package/dist/plugins/index-file.d.ts +2 -14
  53. package/dist/plugins/index-file.js +5 -8
  54. package/dist/plugins/json-schema.d.ts +14 -23
  55. package/dist/plugins/json-schema.d.ts.map +1 -0
  56. package/dist/plugins/json-schema.js +70 -78
  57. package/dist/plugins/json-schema.js.map +1 -0
  58. package/dist/plugins/last-modified.d.ts +21 -32
  59. package/dist/plugins/last-modified.d.ts.map +1 -0
  60. package/dist/plugins/last-modified.js +70 -78
  61. package/dist/plugins/last-modified.js.map +1 -0
  62. package/dist/preset-gmDZnBcg.js +61 -0
  63. package/dist/preset-gmDZnBcg.js.map +1 -0
  64. package/dist/remark-include-D3G3mAnv.js +247 -0
  65. package/dist/remark-include-D3G3mAnv.js.map +1 -0
  66. package/dist/runtime/browser.d.ts +32 -41
  67. package/dist/runtime/browser.d.ts.map +1 -0
  68. package/dist/runtime/browser.js +56 -63
  69. package/dist/runtime/browser.js.map +1 -0
  70. package/dist/runtime/dynamic.d.ts +13 -21
  71. package/dist/runtime/dynamic.d.ts.map +1 -0
  72. package/dist/runtime/dynamic.js +64 -76
  73. package/dist/runtime/dynamic.js.map +1 -0
  74. package/dist/runtime/server.d.ts +2 -14
  75. package/dist/runtime/server.js +111 -8
  76. package/dist/runtime/server.js.map +1 -0
  77. package/dist/runtime/types.d.ts +2 -61
  78. package/dist/runtime/types.js +1 -0
  79. package/dist/types-B6myALSk.d.ts +63 -0
  80. package/dist/types-B6myALSk.d.ts.map +1 -0
  81. package/dist/vite/index.d.ts +28 -39
  82. package/dist/vite/index.d.ts.map +1 -0
  83. package/dist/vite/index.js +79 -122
  84. package/dist/vite/index.js.map +1 -0
  85. package/dist/webpack/mdx.d.ts +6 -3
  86. package/dist/webpack/mdx.d.ts.map +1 -0
  87. package/dist/webpack/mdx.js +21 -34
  88. package/dist/webpack/mdx.js.map +1 -0
  89. package/dist/webpack/meta.d.ts +6 -3
  90. package/dist/webpack/meta.d.ts.map +1 -0
  91. package/dist/webpack/meta.js +23 -37
  92. package/dist/webpack/meta.js.map +1 -0
  93. package/dist/webpack--VSEE6Zp.js +15 -0
  94. package/dist/webpack--VSEE6Zp.js.map +1 -0
  95. package/loader-mdx.cjs +1 -3
  96. package/loader-meta.cjs +1 -3
  97. package/package.json +38 -38
  98. package/dist/build-mdx-5XLFMP5P.js +0 -8
  99. package/dist/chunk-257RZJEQ.js +0 -17
  100. package/dist/chunk-2PY3JUIC.js +0 -126
  101. package/dist/chunk-4EUH5CD2.js +0 -173
  102. package/dist/chunk-4JSFLXXT.js +0 -8
  103. package/dist/chunk-5OBUOALK.js +0 -141
  104. package/dist/chunk-DTFUANSF.js +0 -40
  105. package/dist/chunk-KWSETXYC.js +0 -274
  106. package/dist/chunk-OLD35ARB.js +0 -116
  107. package/dist/chunk-S7KOJHHO.js +0 -89
  108. package/dist/chunk-STLEUNK7.js +0 -335
  109. package/dist/chunk-USQZ5OLE.js +0 -116
  110. package/dist/chunk-VWJKRQZR.js +0 -19
  111. package/dist/chunk-WFDF56IJ.js +0 -290
  112. package/dist/chunk-WSQ23PNV.js +0 -179
  113. package/dist/chunk-ZAYZWFWP.js +0 -89
  114. package/dist/core-X5ggQtBM.d.ts +0 -350
  115. package/dist/index-BqkSNsGO.d.ts +0 -8
  116. package/dist/load-from-file-FHW724YY.js +0 -8
@@ -1,290 +0,0 @@
1
- import {
2
- fumaMatter
3
- } from "./chunk-VWJKRQZR.js";
4
-
5
- // src/loaders/mdx/remark-include.ts
6
- import { unified } from "unified";
7
- import { visit as visit2 } from "unist-util-visit";
8
- import * as path from "path";
9
- import * as fs from "fs/promises";
10
- import { remarkHeading } from "fumadocs-core/mdx-plugins";
11
- import { VFile } from "vfile";
12
-
13
- // src/loaders/mdx/remark-unravel.ts
14
- import { visit } from "unist-util-visit";
15
- function remarkMarkAndUnravel() {
16
- return (tree) => {
17
- visit(tree, function(node, index, parent) {
18
- let offset = -1;
19
- let all = true;
20
- let oneOrMore = false;
21
- if (parent && typeof index === "number" && node.type === "paragraph") {
22
- const children = node.children;
23
- while (++offset < children.length) {
24
- const child = children[offset];
25
- if (child.type === "mdxJsxTextElement" || child.type === "mdxTextExpression") {
26
- oneOrMore = true;
27
- } else if (child.type === "text" && child.value.trim().length === 0) {
28
- } else {
29
- all = false;
30
- break;
31
- }
32
- }
33
- if (all && oneOrMore) {
34
- offset = -1;
35
- const newChildren = [];
36
- while (++offset < children.length) {
37
- const child = children[offset];
38
- if (child.type === "mdxJsxTextElement") {
39
- child.type = "mdxJsxFlowElement";
40
- }
41
- if (child.type === "mdxTextExpression") {
42
- child.type = "mdxFlowExpression";
43
- }
44
- if (child.type === "text" && /^[\t\r\n ]+$/.test(String(child.value))) {
45
- } else {
46
- newChildren.push(child);
47
- }
48
- }
49
- parent.children.splice(index, 1, ...newChildren);
50
- return index;
51
- }
52
- }
53
- });
54
- };
55
- }
56
-
57
- // src/loaders/mdx/mdast-utils.ts
58
- function flattenNode(node) {
59
- if ("children" in node)
60
- return node.children.map((child) => flattenNode(child)).join("");
61
- if ("value" in node) return node.value;
62
- return "";
63
- }
64
-
65
- // src/loaders/mdx/remark-include.ts
66
- var REGION_MARKERS = [
67
- {
68
- start: /^\s*\/\/\s*#?region\b\s*(.*?)\s*$/,
69
- end: /^\s*\/\/\s*#?endregion\b\s*(.*?)\s*$/
70
- },
71
- {
72
- start: /^\s*<!--\s*#?region\b\s*(.*?)\s*-->/,
73
- end: /^\s*<!--\s*#?endregion\b\s*(.*?)\s*-->/
74
- },
75
- {
76
- start: /^\s*\/\*\s*#region\b\s*(.*?)\s*\*\//,
77
- end: /^\s*\/\*\s*#endregion\b\s*(.*?)\s*\*\//
78
- },
79
- {
80
- start: /^\s*#[rR]egion\b\s*(.*?)\s*$/,
81
- end: /^\s*#[eE]nd ?[rR]egion\b\s*(.*?)\s*$/
82
- },
83
- {
84
- start: /^\s*#\s*#?region\b\s*(.*?)\s*$/,
85
- end: /^\s*#\s*#?endregion\b\s*(.*?)\s*$/
86
- },
87
- {
88
- start: /^\s*(?:--|::|@?REM)\s*#region\b\s*(.*?)\s*$/,
89
- end: /^\s*(?:--|::|@?REM)\s*#endregion\b\s*(.*?)\s*$/
90
- },
91
- {
92
- start: /^\s*#pragma\s+region\b\s*(.*?)\s*$/,
93
- end: /^\s*#pragma\s+endregion\b\s*(.*?)\s*$/
94
- },
95
- {
96
- start: /^\s*\(\*\s*#region\b\s*(.*?)\s*\*\)/,
97
- end: /^\s*\(\*\s*#endregion\b\s*(.*?)\s*\*\)/
98
- }
99
- ];
100
- function dedent(lines) {
101
- const minIndent = lines.reduce((min, line) => {
102
- const match = line.match(/^(\s*)\S/);
103
- return match ? Math.min(min, match[1].length) : min;
104
- }, Infinity);
105
- return minIndent === Infinity ? lines.join("\n") : lines.map((l) => l.slice(minIndent)).join("\n");
106
- }
107
- function extractCodeRegion(content, regionName) {
108
- const lines = content.split("\n");
109
- for (let i = 0; i < lines.length; i++) {
110
- for (const re of REGION_MARKERS) {
111
- let match = re.start.exec(lines[i]);
112
- if (match?.[1] !== regionName) continue;
113
- let depth = 1;
114
- const extractedLines = [];
115
- for (let j = i + 1; j < lines.length; j++) {
116
- match = re.start.exec(lines[j]);
117
- if (match) {
118
- depth++;
119
- continue;
120
- }
121
- match = re.end.exec(lines[j]);
122
- if (match) {
123
- if (match[1] === regionName) depth = 0;
124
- else if (match[1] === "") depth--;
125
- else continue;
126
- if (depth > 0) continue;
127
- return dedent(extractedLines);
128
- } else {
129
- extractedLines.push(lines[j]);
130
- }
131
- }
132
- }
133
- }
134
- throw new Error(`Region "${regionName}" not found`);
135
- }
136
- var ElementLikeTypes = [
137
- "mdxJsxFlowElement",
138
- "mdxJsxTextElement",
139
- "containerDirective",
140
- "textDirective",
141
- "leafDirective"
142
- ];
143
- function isElementLike(node) {
144
- return ElementLikeTypes.includes(node.type);
145
- }
146
- function parseElementAttributes(element) {
147
- if (Array.isArray(element.attributes)) {
148
- const attributes = {};
149
- for (const attr of element.attributes) {
150
- if (attr.type === "mdxJsxAttribute" && (typeof attr.value === "string" || attr.value === null)) {
151
- attributes[attr.name] = attr.value;
152
- }
153
- }
154
- return attributes;
155
- }
156
- return element.attributes ?? {};
157
- }
158
- function parseSpecifier(specifier) {
159
- const idx = specifier.lastIndexOf("#");
160
- if (idx === -1) return { file: specifier };
161
- return {
162
- file: specifier.slice(0, idx),
163
- section: specifier.slice(idx + 1)
164
- };
165
- }
166
- function extractSection(root, section) {
167
- let nodes;
168
- let capturingHeadingContent = false;
169
- visit2(root, (node) => {
170
- if (node.type === "heading") {
171
- if (capturingHeadingContent) {
172
- return false;
173
- }
174
- if (node.data?.hProperties?.id === section) {
175
- capturingHeadingContent = true;
176
- nodes = [node];
177
- return "skip";
178
- }
179
- return;
180
- }
181
- if (capturingHeadingContent) {
182
- nodes?.push(node);
183
- return "skip";
184
- }
185
- if (isElementLike(node) && node.name === "section") {
186
- const attributes = parseElementAttributes(node);
187
- if (attributes.id === section) {
188
- nodes = node.children;
189
- return false;
190
- }
191
- }
192
- });
193
- if (nodes)
194
- return {
195
- type: "root",
196
- children: nodes
197
- };
198
- }
199
- function remarkInclude() {
200
- const TagName = "include";
201
- const embedContent = async (targetPath, heading, params, parent) => {
202
- const { _getProcessor = () => this, _compiler } = parent.data;
203
- let content;
204
- try {
205
- content = (await fs.readFile(targetPath)).toString();
206
- } catch (e) {
207
- throw new Error(
208
- `failed to read file ${targetPath}
209
- ${e instanceof Error ? e.message : String(e)}`,
210
- { cause: e }
211
- );
212
- }
213
- const ext = path.extname(targetPath);
214
- _compiler?.addDependency(targetPath);
215
- if (params.lang || ext !== ".md" && ext !== ".mdx") {
216
- const lang = params.lang ?? ext.slice(1);
217
- let value = content;
218
- if (heading) {
219
- value = extractCodeRegion(content, heading.trim());
220
- }
221
- return {
222
- type: "code",
223
- lang,
224
- meta: params.meta,
225
- value,
226
- data: {}
227
- };
228
- }
229
- const parser = _getProcessor(ext === ".mdx" ? "mdx" : "md");
230
- const parsed = fumaMatter(content);
231
- const targetFile = new VFile({
232
- path: targetPath,
233
- value: parsed.content,
234
- data: {
235
- ...parent.data,
236
- frontmatter: parsed.data
237
- }
238
- });
239
- let mdast = parser.parse(targetFile);
240
- const baseProcessor = unified().use(remarkMarkAndUnravel);
241
- if (heading) {
242
- const extracted = extractSection(
243
- await baseProcessor.use(remarkHeading).run(mdast),
244
- heading
245
- );
246
- if (!extracted)
247
- throw new Error(
248
- `Cannot find section ${heading} in ${targetPath}, make sure you have encapsulated the section in a <section id="${heading}"> tag, or a :::section directive with remark-directive configured.`
249
- );
250
- mdast = extracted;
251
- } else {
252
- mdast = await baseProcessor.run(mdast);
253
- }
254
- await update(mdast, targetFile);
255
- return mdast;
256
- };
257
- async function update(tree, file) {
258
- const queue = [];
259
- visit2(tree, ElementLikeTypes, (_node, _, parent) => {
260
- const node = _node;
261
- if (node.name !== TagName) return;
262
- const specifier = flattenNode(node);
263
- if (specifier.length === 0) return "skip";
264
- const attributes = parseElementAttributes(node);
265
- const { file: relativePath, section } = parseSpecifier(specifier);
266
- const targetPath = path.resolve(
267
- "cwd" in attributes ? file.cwd : file.dirname,
268
- relativePath
269
- );
270
- queue.push(
271
- embedContent(targetPath, section, attributes, file).then((replace) => {
272
- Object.assign(
273
- parent && parent.type === "paragraph" ? parent : node,
274
- replace
275
- );
276
- })
277
- );
278
- return "skip";
279
- });
280
- await Promise.all(queue);
281
- }
282
- return async (tree, file) => {
283
- await update(tree, file);
284
- };
285
- }
286
-
287
- export {
288
- flattenNode,
289
- remarkInclude
290
- };
@@ -1,179 +0,0 @@
1
- import {
2
- ValidationError
3
- } from "./chunk-KWSETXYC.js";
4
-
5
- // src/loaders/adapter.ts
6
- import { fileURLToPath } from "url";
7
- import fs from "fs/promises";
8
- import { parse } from "querystring";
9
- import path from "path";
10
- import { readFileSync } from "fs";
11
- function toNode(loader) {
12
- return async (url, _context, nextLoad) => {
13
- if (url.startsWith("file:///") && (!loader.test || loader.test.test(url))) {
14
- const parsedUrl = new URL(url);
15
- const filePath = fileURLToPath(parsedUrl);
16
- const result = await loader.load({
17
- filePath,
18
- query: Object.fromEntries(parsedUrl.searchParams.entries()),
19
- async getSource() {
20
- return (await fs.readFile(filePath)).toString();
21
- },
22
- development: false,
23
- compiler: {
24
- addDependency() {
25
- }
26
- }
27
- });
28
- if (result) {
29
- return {
30
- source: result.code,
31
- format: "module",
32
- shortCircuit: true
33
- };
34
- }
35
- }
36
- return nextLoad(url);
37
- };
38
- }
39
- function toVite(loader) {
40
- return {
41
- filter(id) {
42
- return !loader.test || loader.test.test(id);
43
- },
44
- async transform(value, id) {
45
- const [file, query = ""] = id.split("?", 2);
46
- const result = await loader.load({
47
- filePath: file,
48
- query: parse(query),
49
- getSource() {
50
- return value;
51
- },
52
- development: this.environment.mode === "dev",
53
- compiler: {
54
- addDependency: (file2) => {
55
- this.addWatchFile(file2);
56
- }
57
- }
58
- });
59
- if (result === null) return null;
60
- return {
61
- code: result.code,
62
- map: result.map
63
- };
64
- }
65
- };
66
- }
67
- function toWebpack(loader) {
68
- return async function(source, callback) {
69
- try {
70
- const result = await loader.load({
71
- filePath: this.resourcePath,
72
- query: parse(this.resourceQuery.slice(1)),
73
- getSource() {
74
- return source;
75
- },
76
- development: this.mode === "development",
77
- compiler: this
78
- });
79
- if (result === null) {
80
- callback(void 0, source);
81
- } else {
82
- callback(void 0, result.code, result.map);
83
- }
84
- } catch (error) {
85
- if (error instanceof ValidationError) {
86
- return callback(new Error(await error.toStringFormatted()));
87
- }
88
- if (!(error instanceof Error)) throw error;
89
- const fpath = path.relative(this.context, this.resourcePath);
90
- error.message = `${fpath}:${error.name}: ${error.message}`;
91
- callback(error);
92
- }
93
- };
94
- }
95
- function toBun(loader) {
96
- function toResult(output) {
97
- if (!output) return;
98
- return {
99
- contents: output.code,
100
- loader: "js"
101
- };
102
- }
103
- return (build) => {
104
- build.onLoad({ filter: loader.test ?? /.+/ }, (args) => {
105
- const [filePath, query = ""] = args.path.split("?", 2);
106
- const input = {
107
- async getSource() {
108
- return Bun.file(filePath).text();
109
- },
110
- query: parse(query),
111
- filePath,
112
- development: false,
113
- compiler: {
114
- addDependency() {
115
- }
116
- }
117
- };
118
- if (loader.bun?.load) {
119
- return loader.bun.load(readFileSync(filePath).toString(), input);
120
- }
121
- const result = loader.load(input);
122
- if (result instanceof Promise) {
123
- return result.then(toResult);
124
- }
125
- return toResult(result);
126
- });
127
- };
128
- }
129
-
130
- // src/loaders/config.ts
131
- import fs2 from "fs/promises";
132
- function createStandaloneConfigLoader({
133
- core,
134
- buildConfig,
135
- mode
136
- }) {
137
- let prev;
138
- async function getConfigHash() {
139
- if (mode === "production") return "static";
140
- const stats = await fs2.stat(core.getOptions().configPath).catch(() => {
141
- throw new Error("Cannot find config file");
142
- });
143
- return stats.mtime.getTime().toString();
144
- }
145
- return {
146
- async getCore() {
147
- const hash = await getConfigHash();
148
- if (!prev || hash !== prev.hash) {
149
- prev = {
150
- hash,
151
- init: (async () => {
152
- const { loadConfig } = await import("./load-from-file-FHW724YY.js");
153
- await core.init({
154
- config: loadConfig(core, buildConfig)
155
- });
156
- })()
157
- };
158
- }
159
- await prev.init;
160
- return core;
161
- }
162
- };
163
- }
164
- function createIntegratedConfigLoader(core) {
165
- return {
166
- async getCore() {
167
- return core;
168
- }
169
- };
170
- }
171
-
172
- export {
173
- toNode,
174
- toVite,
175
- toWebpack,
176
- toBun,
177
- createStandaloneConfigLoader,
178
- createIntegratedConfigLoader
179
- };
@@ -1,89 +0,0 @@
1
- import {
2
- metaLoaderGlob
3
- } from "./chunk-4JSFLXXT.js";
4
-
5
- // src/loaders/meta.ts
6
- import { dump, load } from "js-yaml";
7
- import { z } from "zod";
8
- var querySchema = z.object({
9
- collection: z.string().optional(),
10
- workspace: z.string().optional()
11
- }).loose();
12
- function createMetaLoader({ getCore }, resolve = {}) {
13
- const { json: resolveJson = "js", yaml: resolveYaml = "js" } = resolve;
14
- function parse(filePath, source) {
15
- try {
16
- if (filePath.endsWith(".json")) return JSON.parse(source);
17
- if (filePath.endsWith(".yaml")) return load(source);
18
- } catch (e) {
19
- throw new Error(`invalid data in ${filePath}`, { cause: e });
20
- }
21
- throw new Error("Unknown file type " + filePath);
22
- }
23
- function onMeta(source, { filePath, query }) {
24
- const parsed = querySchema.safeParse(query);
25
- if (!parsed.success || !parsed.data.collection) return null;
26
- const { collection: collectionName, workspace } = parsed.data;
27
- return async () => {
28
- let core = await getCore();
29
- if (workspace) {
30
- core = core.getWorkspaces().get(workspace) ?? core;
31
- }
32
- const collection = core.getCollection(collectionName);
33
- let metaCollection;
34
- switch (collection?.type) {
35
- case "meta":
36
- metaCollection = collection;
37
- break;
38
- case "docs":
39
- metaCollection = collection.meta;
40
- break;
41
- }
42
- const data = parse(filePath, source);
43
- if (!metaCollection) return data;
44
- return core.transformMeta(
45
- {
46
- collection: metaCollection,
47
- filePath,
48
- source
49
- },
50
- data
51
- );
52
- };
53
- }
54
- return {
55
- test: metaLoaderGlob,
56
- async load(input) {
57
- const result = onMeta(await input.getSource(), input);
58
- if (result === null) return null;
59
- const data = await result();
60
- if (input.filePath.endsWith(".json")) {
61
- return {
62
- code: resolveJson === "json" ? JSON.stringify(data) : `export default ${JSON.stringify(data)}`
63
- };
64
- } else {
65
- return {
66
- code: resolveYaml === "yaml" ? dump(data) : `export default ${JSON.stringify(data)}`
67
- };
68
- }
69
- },
70
- bun: {
71
- load(source, input) {
72
- const result = onMeta(source, input);
73
- if (result === null)
74
- return {
75
- loader: "object",
76
- exports: parse(input.filePath, source)
77
- };
78
- return result().then((data) => ({
79
- loader: "object",
80
- exports: { default: data }
81
- }));
82
- }
83
- }
84
- };
85
- }
86
-
87
- export {
88
- createMetaLoader
89
- };