fumadocs-mdx 13.0.7 → 14.0.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/bin.cjs +927 -904
- package/dist/bin.js +3 -3
- package/dist/build-mdx-6UAK5FF5.js +8 -0
- package/dist/bun/index.cjs +592 -481
- package/dist/bun/index.d.cts +3 -2
- package/dist/bun/index.d.ts +3 -2
- package/dist/bun/index.js +12 -12
- package/dist/chunk-4JSFLXXT.js +8 -0
- package/dist/chunk-5UMZCWKV.js +17 -0
- package/dist/chunk-5YXP7JLN.js +138 -0
- package/dist/{chunk-2E2JCOSO.js → chunk-6NISOLQ6.js} +16 -44
- package/dist/chunk-7L2KNF6B.js +180 -0
- package/dist/chunk-E5DJTSIM.js +86 -0
- package/dist/{chunk-K5ZLPEIQ.js → chunk-FBLMK4RS.js} +9 -6
- package/dist/{chunk-QXHN25N3.js → chunk-OXSRIWQW.js} +7 -8
- package/dist/chunk-PKI7ZDA5.js +29 -0
- package/dist/{chunk-3J3WL7WN.js → chunk-SLY7WXTX.js} +71 -58
- package/dist/{chunk-ETIN2W7C.js → chunk-SRSRFOVI.js} +22 -19
- package/dist/chunk-TYJDYTKH.js +85 -0
- package/dist/chunk-XHJCLBZ4.js +406 -0
- package/dist/{chunk-2HXTGJBI.js → chunk-ZY6UZ7NH.js} +22 -19
- package/dist/config/index.cjs +79 -71
- package/dist/config/index.d.cts +2 -1
- package/dist/config/index.d.ts +2 -1
- package/dist/config/index.js +5 -5
- package/dist/index-BlVBvy-z.d.ts +8 -0
- package/dist/{core-HkAVGq_a.d.cts → index-D7JdSMpp.d.cts} +99 -61
- package/dist/{core-HkAVGq_a.d.ts → index-D7JdSMpp.d.ts} +99 -61
- package/dist/index-P2NNUkHn.d.cts +8 -0
- package/dist/index.d.cts +3 -74
- package/dist/index.d.ts +3 -74
- package/dist/load-from-file-I3ALLIVB.js +8 -0
- package/dist/next/index.cjs +698 -476
- package/dist/next/index.d.cts +11 -1
- package/dist/next/index.d.ts +11 -1
- package/dist/next/index.js +78 -281
- package/dist/node/loader.cjs +705 -603
- package/dist/node/loader.js +10 -11
- package/dist/plugins/index-file.cjs +471 -0
- package/dist/plugins/index-file.d.cts +29 -0
- package/dist/plugins/index-file.d.ts +29 -0
- package/dist/plugins/index-file.js +8 -0
- package/dist/plugins/json-schema.d.cts +3 -2
- package/dist/plugins/json-schema.d.ts +3 -2
- package/dist/plugins/last-modified.cjs +75 -0
- package/dist/plugins/last-modified.d.cts +27 -0
- package/dist/plugins/last-modified.d.ts +27 -0
- package/dist/plugins/last-modified.js +44 -0
- package/dist/runtime/{vite/browser.cjs → browser.cjs} +40 -53
- package/dist/runtime/browser.d.cts +50 -0
- package/dist/runtime/browser.d.ts +50 -0
- package/dist/runtime/browser.js +68 -0
- package/dist/runtime/dynamic.cjs +985 -0
- package/dist/runtime/dynamic.d.cts +27 -0
- package/dist/runtime/dynamic.d.ts +27 -0
- package/dist/runtime/dynamic.js +78 -0
- package/dist/runtime/server.cjs +173 -0
- package/dist/runtime/server.d.cts +161 -0
- package/dist/runtime/server.d.ts +161 -0
- package/dist/runtime/server.js +8 -0
- package/dist/vite/index.cjs +935 -639
- package/dist/vite/index.d.cts +12 -22
- package/dist/vite/index.d.ts +12 -22
- package/dist/vite/index.js +30 -221
- package/dist/webpack/mdx.cjs +614 -515
- package/dist/webpack/mdx.d.cts +9 -1
- package/dist/webpack/mdx.d.ts +9 -1
- package/dist/webpack/mdx.js +12 -17
- package/dist/webpack/meta.cjs +328 -234
- package/dist/webpack/meta.d.cts +9 -1
- package/dist/webpack/meta.d.ts +9 -1
- package/dist/webpack/meta.js +13 -15
- package/package.json +15 -32
- package/dist/build-mdx-BnJhW5O1.d.cts +0 -53
- package/dist/build-mdx-DNzfRRlY.d.ts +0 -53
- package/dist/chunk-2AQRQXSO.js +0 -119
- package/dist/chunk-4757L6ST.js +0 -77
- package/dist/chunk-CXA4JO4Z.js +0 -45
- package/dist/chunk-FSZMKRVH.js +0 -80
- package/dist/chunk-II3H5ZVZ.js +0 -77
- package/dist/chunk-KILFIBVW.js +0 -75
- package/dist/chunk-NVRDCY6Z.js +0 -30
- package/dist/chunk-VUEZTR2H.js +0 -26
- package/dist/index-D7s7kCc2.d.cts +0 -7
- package/dist/index-D7s7kCc2.d.ts +0 -7
- package/dist/load-from-file-AVYOFOI7.js +0 -7
- package/dist/preset-ZMP6U62C.js +0 -6
- package/dist/runtime/next/async.cjs +0 -760
- package/dist/runtime/next/async.d.cts +0 -19
- package/dist/runtime/next/async.d.ts +0 -19
- package/dist/runtime/next/async.js +0 -86
- package/dist/runtime/next/index.cjs +0 -136
- package/dist/runtime/next/index.d.cts +0 -33
- package/dist/runtime/next/index.d.ts +0 -33
- package/dist/runtime/next/index.js +0 -11
- package/dist/runtime/vite/browser.d.cts +0 -59
- package/dist/runtime/vite/browser.d.ts +0 -59
- package/dist/runtime/vite/browser.js +0 -11
- package/dist/runtime/vite/server.cjs +0 -243
- package/dist/runtime/vite/server.d.cts +0 -30
- package/dist/runtime/vite/server.d.ts +0 -30
- package/dist/runtime/vite/server.js +0 -111
- package/dist/types-By6wKOnT.d.cts +0 -45
- package/dist/types-DgD5Omj2.d.ts +0 -45
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// src/utils/codegen/cache.ts
|
|
2
|
+
import { LRUCache } from "lru-cache";
|
|
3
|
+
import fs from "fs/promises";
|
|
4
|
+
import path from "path";
|
|
5
|
+
var map = new LRUCache({
|
|
6
|
+
max: 100
|
|
7
|
+
});
|
|
8
|
+
function toFullPath(file) {
|
|
9
|
+
if (path.isAbsolute(file)) {
|
|
10
|
+
return path.relative(process.cwd(), file);
|
|
11
|
+
}
|
|
12
|
+
return file;
|
|
13
|
+
}
|
|
14
|
+
async function readFileWithCache(file) {
|
|
15
|
+
const fullPath = toFullPath(file);
|
|
16
|
+
const cached = map.get(fullPath);
|
|
17
|
+
if (cached) return cached;
|
|
18
|
+
const read = fs.readFile(fullPath).then((s) => s.toString());
|
|
19
|
+
map.set(fullPath, read);
|
|
20
|
+
return read;
|
|
21
|
+
}
|
|
22
|
+
function removeFileCache(file) {
|
|
23
|
+
map.delete(toFullPath(file));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
readFileWithCache,
|
|
28
|
+
removeFileCache
|
|
29
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
flattenNode,
|
|
2
3
|
remarkInclude
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBLMK4RS.js";
|
|
4
5
|
|
|
5
6
|
// src/loaders/mdx/build-mdx.ts
|
|
6
7
|
import { createProcessor } from "@mdx-js/mdx";
|
|
8
|
+
import { VFile } from "vfile";
|
|
7
9
|
|
|
8
10
|
// src/loaders/mdx/remark-postprocess.ts
|
|
9
11
|
import { visit } from "unist-util-visit";
|
|
@@ -15,48 +17,66 @@ function remarkPostprocess({
|
|
|
15
17
|
_format,
|
|
16
18
|
includeProcessedMarkdown = false,
|
|
17
19
|
includeMDAST = false,
|
|
20
|
+
extractLinkReferences = false,
|
|
18
21
|
valueToExport = []
|
|
19
22
|
}) {
|
|
20
23
|
let _stringifyProcessor;
|
|
21
24
|
const getStringifyProcessor = () => {
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
return _stringifyProcessor ??= _format === "mdx" ? this : (
|
|
26
|
+
// force Markdown processor to stringify MDX nodes
|
|
27
|
+
this().use(remarkMdx).freeze()
|
|
28
|
+
);
|
|
24
29
|
};
|
|
25
30
|
return (tree, file) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const frontmatter = file.data.frontmatter ??= {};
|
|
32
|
+
if (!frontmatter.title) {
|
|
33
|
+
visit(tree, "heading", (node) => {
|
|
34
|
+
if (node.depth === 1) {
|
|
35
|
+
frontmatter.title = flattenNode(node);
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
file.data["mdx-export"] ??= [];
|
|
41
|
+
if (extractLinkReferences) {
|
|
42
|
+
const urls = [];
|
|
43
|
+
visit(tree, "link", (node) => {
|
|
44
|
+
urls.push({
|
|
45
|
+
href: node.url
|
|
46
|
+
});
|
|
47
|
+
return "skip";
|
|
48
|
+
});
|
|
49
|
+
file.data["mdx-export"].push({
|
|
50
|
+
name: "extractedReferences",
|
|
51
|
+
value: urls
|
|
35
52
|
});
|
|
36
|
-
return "skip";
|
|
37
|
-
});
|
|
38
|
-
if (title) {
|
|
39
|
-
file.data.frontmatter ??= {};
|
|
40
|
-
if (!file.data.frontmatter.title) file.data.frontmatter.title = title;
|
|
41
53
|
}
|
|
42
|
-
file.data.extractedReferences = urls;
|
|
43
54
|
if (includeProcessedMarkdown) {
|
|
44
55
|
const processor = getStringifyProcessor();
|
|
45
|
-
|
|
56
|
+
const markdown = toMarkdown(tree, {
|
|
46
57
|
...processor.data("settings"),
|
|
47
58
|
// from https://github.com/remarkjs/remark/blob/main/packages/remark-stringify/lib/index.js
|
|
48
59
|
extensions: processor.data("toMarkdownExtensions") || []
|
|
49
60
|
});
|
|
61
|
+
file.data["mdx-export"].push({
|
|
62
|
+
name: "_markdown",
|
|
63
|
+
value: markdown
|
|
64
|
+
});
|
|
50
65
|
}
|
|
51
66
|
if (includeMDAST) {
|
|
52
67
|
const options = includeMDAST === true ? {} : includeMDAST;
|
|
53
|
-
|
|
68
|
+
const mdast = JSON.stringify(
|
|
54
69
|
options.removePosition ? removePosition(structuredClone(tree)) : tree
|
|
55
70
|
);
|
|
71
|
+
file.data["mdx-export"].push({
|
|
72
|
+
name: "_mdast",
|
|
73
|
+
value: mdast
|
|
74
|
+
});
|
|
56
75
|
}
|
|
57
|
-
for (const { name, value } of file.data["mdx-export"]
|
|
76
|
+
for (const { name, value } of file.data["mdx-export"]) {
|
|
58
77
|
tree.children.unshift(getMdastExport(name, value));
|
|
59
78
|
}
|
|
79
|
+
file.data["mdx-export"] = [];
|
|
60
80
|
for (const name of valueToExport) {
|
|
61
81
|
if (!(name in file.data)) continue;
|
|
62
82
|
tree.children.unshift(getMdastExport(name, file.data[name]));
|
|
@@ -97,43 +117,39 @@ function getMdastExport(name, value) {
|
|
|
97
117
|
}
|
|
98
118
|
};
|
|
99
119
|
}
|
|
100
|
-
function flattenNode(node) {
|
|
101
|
-
if ("children" in node)
|
|
102
|
-
return node.children.map((child) => flattenNode(child)).join("");
|
|
103
|
-
if ("value" in node) return node.value;
|
|
104
|
-
return "";
|
|
105
|
-
}
|
|
106
120
|
|
|
107
121
|
// src/loaders/mdx/build-mdx.ts
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
122
|
+
async function buildMDX(core, collection, {
|
|
123
|
+
filePath,
|
|
124
|
+
frontmatter,
|
|
125
|
+
source,
|
|
126
|
+
_compiler,
|
|
127
|
+
environment,
|
|
128
|
+
isDevelopment
|
|
129
|
+
}) {
|
|
130
|
+
const mdxOptions = await core.getConfig().getMDXOptions(collection, environment);
|
|
111
131
|
function getProcessor(format) {
|
|
112
|
-
const
|
|
132
|
+
const cache = core.cache;
|
|
133
|
+
const key = `build-mdx:${collection?.name ?? "global"}:${format}`;
|
|
113
134
|
let processor = cache.get(key);
|
|
114
135
|
if (!processor) {
|
|
136
|
+
const postprocessOptions = {
|
|
137
|
+
_format: format,
|
|
138
|
+
...collection?.postprocess,
|
|
139
|
+
valueToExport: [
|
|
140
|
+
...collection?.postprocess?.valueToExport ?? [],
|
|
141
|
+
"structuredData",
|
|
142
|
+
"frontmatter"
|
|
143
|
+
]
|
|
144
|
+
};
|
|
115
145
|
processor = createProcessor({
|
|
116
146
|
outputFormat: "program",
|
|
117
|
-
|
|
147
|
+
development: isDevelopment,
|
|
148
|
+
...mdxOptions,
|
|
118
149
|
remarkPlugins: [
|
|
119
150
|
remarkInclude,
|
|
120
|
-
...
|
|
121
|
-
[
|
|
122
|
-
remarkPostprocess,
|
|
123
|
-
{
|
|
124
|
-
_format: format,
|
|
125
|
-
...options.postprocess,
|
|
126
|
-
valueToExport: [
|
|
127
|
-
...options.postprocess?.valueToExport ?? [],
|
|
128
|
-
"structuredData",
|
|
129
|
-
"extractedReferences",
|
|
130
|
-
"frontmatter",
|
|
131
|
-
"lastModified",
|
|
132
|
-
"_markdown",
|
|
133
|
-
"_mdast"
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
]
|
|
151
|
+
...mdxOptions.remarkPlugins ?? [],
|
|
152
|
+
[remarkPostprocess, postprocessOptions]
|
|
137
153
|
],
|
|
138
154
|
format
|
|
139
155
|
});
|
|
@@ -141,18 +157,15 @@ async function buildMDX(cacheKey, source, options) {
|
|
|
141
157
|
}
|
|
142
158
|
return processor;
|
|
143
159
|
}
|
|
144
|
-
|
|
145
|
-
options.format ?? (filePath.endsWith(".mdx") ? "mdx" : "md")
|
|
146
|
-
).process({
|
|
160
|
+
let vfile = new VFile({
|
|
147
161
|
value: source,
|
|
148
162
|
path: filePath,
|
|
149
|
-
data: {
|
|
150
|
-
...data,
|
|
151
|
-
frontmatter,
|
|
152
|
-
_compiler,
|
|
153
|
-
_getProcessor: getProcessor
|
|
154
|
-
}
|
|
163
|
+
data: { frontmatter, _compiler, _getProcessor: getProcessor }
|
|
155
164
|
});
|
|
165
|
+
if (collection) {
|
|
166
|
+
vfile = await core.transformVFile({ collection, filePath, source }, vfile);
|
|
167
|
+
}
|
|
168
|
+
return getProcessor(filePath.endsWith(".mdx") ? "mdx" : "md").process(vfile);
|
|
156
169
|
}
|
|
157
170
|
|
|
158
171
|
export {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ValidationError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7L2KNF6B.js";
|
|
4
4
|
|
|
5
5
|
// src/loaders/adapter.ts
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
import fs from "fs/promises";
|
|
8
8
|
import { parse } from "querystring";
|
|
9
9
|
import path from "path";
|
|
10
|
+
import { readFileSync } from "fs";
|
|
10
11
|
function toNode(loader) {
|
|
11
12
|
return async (url, _context, nextLoad) => {
|
|
12
13
|
if (url.startsWith("file:///") && (!loader.test || loader.test.test(url))) {
|
|
@@ -82,7 +83,7 @@ function toWebpack(loader) {
|
|
|
82
83
|
}
|
|
83
84
|
} catch (error) {
|
|
84
85
|
if (error instanceof ValidationError) {
|
|
85
|
-
return callback(new Error(error.toStringFormatted()));
|
|
86
|
+
return callback(new Error(await error.toStringFormatted()));
|
|
86
87
|
}
|
|
87
88
|
if (!(error instanceof Error)) throw error;
|
|
88
89
|
const fpath = path.relative(this.context, this.resourcePath);
|
|
@@ -92,8 +93,15 @@ function toWebpack(loader) {
|
|
|
92
93
|
};
|
|
93
94
|
}
|
|
94
95
|
function toBun(loader) {
|
|
96
|
+
function toResult(output) {
|
|
97
|
+
if (!output) return;
|
|
98
|
+
return {
|
|
99
|
+
contents: output.code,
|
|
100
|
+
loader: "js"
|
|
101
|
+
};
|
|
102
|
+
}
|
|
95
103
|
return (build) => {
|
|
96
|
-
build.onLoad({ filter: loader.test ?? /.+/ },
|
|
104
|
+
build.onLoad({ filter: loader.test ?? /.+/ }, (args) => {
|
|
97
105
|
const [filePath, query = ""] = args.path.split("?", 2);
|
|
98
106
|
const input = {
|
|
99
107
|
async getSource() {
|
|
@@ -107,17 +115,14 @@ function toBun(loader) {
|
|
|
107
115
|
}
|
|
108
116
|
}
|
|
109
117
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (!loader.bun?.fallback) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
return loader.bun.fallback(input);
|
|
118
|
+
if (loader.bun?.load) {
|
|
119
|
+
return loader.bun.load(readFileSync(filePath).toString(), input);
|
|
116
120
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
+
const result = loader.load(input);
|
|
122
|
+
if (result instanceof Promise) {
|
|
123
|
+
return result.then(toResult);
|
|
124
|
+
}
|
|
125
|
+
return toResult(result);
|
|
121
126
|
});
|
|
122
127
|
};
|
|
123
128
|
}
|
|
@@ -138,17 +143,14 @@ function createStandaloneConfigLoader({
|
|
|
138
143
|
return stats.mtime.getTime().toString();
|
|
139
144
|
}
|
|
140
145
|
async function newConfig() {
|
|
141
|
-
const { loadConfig } = await import("./load-from-file-
|
|
146
|
+
const { loadConfig } = await import("./load-from-file-I3ALLIVB.js");
|
|
142
147
|
await core.init({
|
|
143
|
-
config: loadConfig(
|
|
144
|
-
core._options.configPath,
|
|
145
|
-
core._options.outDir,
|
|
146
|
-
buildConfig
|
|
147
|
-
)
|
|
148
|
+
config: loadConfig(core, buildConfig)
|
|
148
149
|
});
|
|
149
150
|
return core.getConfig();
|
|
150
151
|
}
|
|
151
152
|
return {
|
|
153
|
+
core,
|
|
152
154
|
async getConfig() {
|
|
153
155
|
const hash = await getConfigHash();
|
|
154
156
|
if (loaded && loaded.hash === hash) return loaded.config;
|
|
@@ -162,6 +164,7 @@ function createStandaloneConfigLoader({
|
|
|
162
164
|
}
|
|
163
165
|
function createIntegratedConfigLoader(core) {
|
|
164
166
|
return {
|
|
167
|
+
core,
|
|
165
168
|
getConfig() {
|
|
166
169
|
return core.getConfig();
|
|
167
170
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
}).loose();
|
|
11
|
+
function createMetaLoader(configLoader, resolve = {}) {
|
|
12
|
+
const { json: resolveJson = "js", yaml: resolveYaml = "js" } = resolve;
|
|
13
|
+
function parse(filePath, source) {
|
|
14
|
+
try {
|
|
15
|
+
if (filePath.endsWith(".json")) return JSON.parse(source);
|
|
16
|
+
if (filePath.endsWith(".yaml")) return load(source);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
throw new Error(`invalid data in ${filePath}`, { cause: e });
|
|
19
|
+
}
|
|
20
|
+
throw new Error("Unknown file type " + filePath);
|
|
21
|
+
}
|
|
22
|
+
function onMeta(source, { filePath, query }) {
|
|
23
|
+
const parsed = querySchema.safeParse(query);
|
|
24
|
+
if (!parsed.success || !parsed.data.collection) return null;
|
|
25
|
+
const collectionName = parsed.data.collection;
|
|
26
|
+
return async () => {
|
|
27
|
+
const config = await configLoader.getConfig();
|
|
28
|
+
const collection = config.getCollection(collectionName);
|
|
29
|
+
let metaCollection;
|
|
30
|
+
switch (collection?.type) {
|
|
31
|
+
case "meta":
|
|
32
|
+
metaCollection = collection;
|
|
33
|
+
break;
|
|
34
|
+
case "docs":
|
|
35
|
+
metaCollection = collection.meta;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
const data = parse(filePath, source);
|
|
39
|
+
if (!metaCollection) return data;
|
|
40
|
+
return configLoader.core.transformMeta(
|
|
41
|
+
{
|
|
42
|
+
collection: metaCollection,
|
|
43
|
+
filePath,
|
|
44
|
+
source
|
|
45
|
+
},
|
|
46
|
+
data
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
test: metaLoaderGlob,
|
|
52
|
+
async load(input) {
|
|
53
|
+
const result = onMeta(await input.getSource(), input);
|
|
54
|
+
if (result === null) return null;
|
|
55
|
+
const data = await result();
|
|
56
|
+
if (input.filePath.endsWith(".json")) {
|
|
57
|
+
return {
|
|
58
|
+
code: resolveJson === "json" ? JSON.stringify(data) : `export default ${JSON.stringify(data)}`
|
|
59
|
+
};
|
|
60
|
+
} else {
|
|
61
|
+
return {
|
|
62
|
+
code: resolveYaml === "yaml" ? dump(data) : `export default ${JSON.stringify(data)}`
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
bun: {
|
|
67
|
+
load(source, input) {
|
|
68
|
+
const result = onMeta(source, input);
|
|
69
|
+
if (result === null)
|
|
70
|
+
return {
|
|
71
|
+
loader: "object",
|
|
72
|
+
exports: parse(input.filePath, source)
|
|
73
|
+
};
|
|
74
|
+
return result().then((data) => ({
|
|
75
|
+
loader: "object",
|
|
76
|
+
exports: { default: data }
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
createMetaLoader
|
|
85
|
+
};
|