fumadocs-mdx 14.0.0 → 14.0.1

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 (67) hide show
  1. package/dist/bin.cjs +270 -201
  2. package/dist/bun/index.cjs +63 -28
  3. package/dist/bun/index.d.cts +7 -1
  4. package/dist/bun/index.d.ts +7 -1
  5. package/dist/bun/index.js +6 -5
  6. package/dist/{chunk-5YXP7JLN.js → chunk-5OBUOALK.js} +8 -5
  7. package/dist/{chunk-XHJCLBZ4.js → chunk-7UKSZSPY.js} +87 -162
  8. package/dist/{chunk-7L2KNF6B.js → chunk-BEBCWQC7.js} +51 -7
  9. package/dist/{chunk-5UMZCWKV.js → chunk-IQGEFL2B.js} +1 -1
  10. package/dist/{chunk-SRSRFOVI.js → chunk-K6HCOGOX.js} +3 -3
  11. package/dist/{chunk-OXSRIWQW.js → chunk-MTTISKQJ.js} +3 -2
  12. package/dist/chunk-WBIHDYMN.js +126 -0
  13. package/dist/config/index.d.cts +6 -1
  14. package/dist/config/index.d.ts +6 -1
  15. package/dist/{index-D7JdSMpp.d.cts → core-B9ZoS6sA.d.ts} +73 -4
  16. package/dist/{index-D7JdSMpp.d.ts → core-DTuP23zu.d.cts} +73 -4
  17. package/dist/{index-BlVBvy-z.d.ts → index-BD8Woo4m.d.cts} +1 -1
  18. package/dist/{index-P2NNUkHn.d.cts → index-CNOvhtOn.d.ts} +1 -1
  19. package/dist/index.d.cts +56 -3
  20. package/dist/index.d.ts +56 -3
  21. package/dist/{load-from-file-I3ALLIVB.js → load-from-file-5HUQN36V.js} +1 -1
  22. package/dist/next/index.cjs +260 -192
  23. package/dist/next/index.d.cts +7 -2
  24. package/dist/next/index.d.ts +7 -2
  25. package/dist/next/index.js +10 -8
  26. package/dist/node/loader.cjs +72 -37
  27. package/dist/node/loader.js +3 -3
  28. package/dist/plugins/index-file.cjs +69 -45
  29. package/dist/plugins/index-file.d.cts +7 -22
  30. package/dist/plugins/index-file.d.ts +7 -22
  31. package/dist/plugins/index-file.js +2 -2
  32. package/dist/plugins/json-schema.d.cts +7 -1
  33. package/dist/plugins/json-schema.d.ts +7 -1
  34. package/dist/plugins/last-modified.cjs +41 -6
  35. package/dist/plugins/last-modified.d.cts +11 -1
  36. package/dist/plugins/last-modified.d.ts +11 -1
  37. package/dist/plugins/last-modified.js +34 -4
  38. package/dist/runtime/browser.cjs +7 -8
  39. package/dist/runtime/browser.d.cts +22 -19
  40. package/dist/runtime/browser.d.ts +22 -19
  41. package/dist/runtime/browser.js +5 -6
  42. package/dist/runtime/dynamic.cjs +81 -43
  43. package/dist/runtime/dynamic.d.cts +12 -12
  44. package/dist/runtime/dynamic.d.ts +12 -12
  45. package/dist/runtime/dynamic.js +9 -8
  46. package/dist/runtime/server.cjs +9 -6
  47. package/dist/runtime/server.d.cts +10 -157
  48. package/dist/runtime/server.d.ts +10 -157
  49. package/dist/runtime/server.js +3 -3
  50. package/dist/runtime/types.cjs +18 -0
  51. package/dist/runtime/types.d.cts +61 -0
  52. package/dist/runtime/types.d.ts +61 -0
  53. package/dist/runtime/types.js +0 -0
  54. package/dist/vite/index.cjs +257 -190
  55. package/dist/vite/index.d.cts +7 -2
  56. package/dist/vite/index.d.ts +7 -2
  57. package/dist/vite/index.js +7 -6
  58. package/dist/webpack/mdx.cjs +60 -25
  59. package/dist/webpack/mdx.d.cts +8 -2
  60. package/dist/webpack/mdx.d.ts +8 -2
  61. package/dist/webpack/mdx.js +4 -4
  62. package/dist/webpack/meta.cjs +60 -25
  63. package/dist/webpack/meta.d.cts +8 -2
  64. package/dist/webpack/meta.d.ts +8 -2
  65. package/dist/webpack/meta.js +4 -4
  66. package/package.json +2 -2
  67. package/dist/chunk-PKI7ZDA5.js +0 -29
@@ -653,10 +653,11 @@ __export(load_from_file_exports, {
653
653
  });
654
654
  async function compileConfig(core2) {
655
655
  const { build } = await import("esbuild");
656
+ const { configPath, outDir } = core2.getOptions();
656
657
  const transformed = await build({
657
- entryPoints: [{ in: core2._options.configPath, out: "source.config" }],
658
+ entryPoints: [{ in: configPath, out: "source.config" }],
658
659
  bundle: true,
659
- outdir: core2._options.outDir,
660
+ outdir: outDir,
660
661
  target: "node20",
661
662
  write: true,
662
663
  platform: "node",
@@ -884,7 +885,7 @@ function createStandaloneConfigLoader({
884
885
  let loaded;
885
886
  async function getConfigHash() {
886
887
  if (mode === "production") return "static";
887
- const stats = await import_promises3.default.stat(core2._options.configPath).catch(() => {
888
+ const stats = await import_promises3.default.stat(core2.getOptions().configPath).catch(() => {
888
889
  throw new Error("Cannot find config file");
889
890
  });
890
891
  return stats.mtime.getTime().toString();
@@ -912,23 +913,13 @@ function createStandaloneConfigLoader({
912
913
 
913
914
  // src/core.ts
914
915
  var import_node_path4 = __toESM(require("path"), 1);
915
- var import_promises5 = __toESM(require("fs/promises"), 1);
916
-
917
- // src/utils/codegen/cache.ts
918
- var import_lru_cache = require("lru-cache");
919
916
  var import_promises4 = __toESM(require("fs/promises"), 1);
917
+
918
+ // src/utils/codegen.ts
920
919
  var import_node_path3 = __toESM(require("path"), 1);
921
- var map = new import_lru_cache.LRUCache({
922
- max: 100
923
- });
924
- function toFullPath(file) {
925
- if (import_node_path3.default.isAbsolute(file)) {
926
- return import_node_path3.default.relative(process.cwd(), file);
927
- }
928
- return file;
929
- }
930
- function removeFileCache(file) {
931
- map.delete(toFullPath(file));
920
+ var import_tinyglobby = require("tinyglobby");
921
+ function ident(code, tab = 1) {
922
+ return code.split("\n").map((v) => " ".repeat(tab) + v).join("\n");
932
923
  }
933
924
 
934
925
  // src/core.ts
@@ -960,7 +951,6 @@ function createCore(options, defaultPlugins = []) {
960
951
  return data;
961
952
  }
962
953
  const core2 = {
963
- _options: options,
964
954
  /**
965
955
  * Convenient cache store, reset when config changes
966
956
  */
@@ -969,6 +959,7 @@ function createCore(options, defaultPlugins = []) {
969
959
  config = await newConfig;
970
960
  this.cache.clear();
971
961
  plugins = await getPlugins([
962
+ postprocessPlugin(),
972
963
  ...defaultPlugins,
973
964
  ...config.global.plugins ?? []
974
965
  ]);
@@ -976,7 +967,9 @@ function createCore(options, defaultPlugins = []) {
976
967
  const out = await plugin.config?.call(pluginContext, config);
977
968
  if (out) config = out;
978
969
  }
979
- return this;
970
+ },
971
+ getOptions() {
972
+ return options;
980
973
  },
981
974
  getConfig() {
982
975
  return config;
@@ -987,10 +980,13 @@ function createCore(options, defaultPlugins = []) {
987
980
  getCompiledConfigPath() {
988
981
  return import_node_path4.default.join(options.outDir, "source.config.mjs");
989
982
  },
983
+ getPlugins() {
984
+ return plugins;
985
+ },
986
+ getPluginContext() {
987
+ return pluginContext;
988
+ },
990
989
  async initServer(server) {
991
- server.watcher?.on("all", async (event, file) => {
992
- if (event === "change") removeFileCache(file);
993
- });
994
990
  for (const plugin of plugins) {
995
991
  await plugin.configureServer?.call(pluginContext, server);
996
992
  }
@@ -1009,8 +1005,8 @@ function createCore(options, defaultPlugins = []) {
1009
1005
  await Promise.all(
1010
1006
  out.map(async (entry) => {
1011
1007
  const file = import_node_path4.default.join(options.outDir, entry.path);
1012
- await import_promises5.default.mkdir(import_node_path4.default.dirname(file), { recursive: true });
1013
- await import_promises5.default.writeFile(file, entry.content);
1008
+ await import_promises4.default.mkdir(import_node_path4.default.dirname(file), { recursive: true });
1009
+ await import_promises4.default.writeFile(file, entry.content);
1014
1010
  })
1015
1011
  );
1016
1012
  console.log(`[MDX] generated files in ${performance.now() - start}ms`);
@@ -1057,6 +1053,45 @@ function createCore(options, defaultPlugins = []) {
1057
1053
  };
1058
1054
  return core2;
1059
1055
  }
1056
+ function postprocessPlugin() {
1057
+ const LinkReferenceTypes = `{
1058
+ /**
1059
+ * extracted references (e.g. hrefs, paths), useful for analyzing relationships between pages.
1060
+ */
1061
+ extractedReferences?: import('fumadocs-mdx').ExtractedReference[];
1062
+ }`;
1063
+ return {
1064
+ "index-file": {
1065
+ generateTypeConfig() {
1066
+ const lines = [];
1067
+ lines.push("{");
1068
+ lines.push(" DocData: {");
1069
+ for (const collection of this.core.getConfig().collectionList) {
1070
+ let postprocessOptions;
1071
+ switch (collection.type) {
1072
+ case "doc":
1073
+ postprocessOptions = collection.postprocess;
1074
+ break;
1075
+ case "docs":
1076
+ postprocessOptions = collection.docs.postprocess;
1077
+ break;
1078
+ }
1079
+ if (postprocessOptions?.extractLinkReferences) {
1080
+ lines.push(ident(`${collection.name}: ${LinkReferenceTypes},`, 2));
1081
+ }
1082
+ }
1083
+ lines.push(" }");
1084
+ lines.push("}");
1085
+ return lines.join("\n");
1086
+ },
1087
+ serverOptions(options) {
1088
+ options.doc ??= {};
1089
+ options.doc.passthroughs ??= [];
1090
+ options.doc.passthroughs.push("extractedReferences");
1091
+ }
1092
+ }
1093
+ };
1094
+ }
1060
1095
 
1061
1096
  // src/webpack/index.ts
1062
1097
  var core;
@@ -1,6 +1,6 @@
1
1
  import { LoaderContext } from 'webpack';
2
- import { W as WebpackLoaderOptions } from '../index-P2NNUkHn.cjs';
3
- import '../index-D7JdSMpp.cjs';
2
+ import { W as WebpackLoaderOptions } from '../index-BD8Woo4m.cjs';
3
+ import '../core-DTuP23zu.cjs';
4
4
  import '@mdx-js/mdx';
5
5
  import '@standard-schema/spec';
6
6
  import 'unified';
@@ -8,6 +8,12 @@ import 'fumadocs-core/mdx-plugins';
8
8
  import 'zod';
9
9
  import 'chokidar';
10
10
  import 'vfile';
11
+ import 'fumadocs-core/source';
12
+ import '../runtime/types.cjs';
13
+ import 'fumadocs-core/mdx-plugins/remark-structure';
14
+ import 'fumadocs-core/toc';
15
+ import 'mdast';
16
+ import 'mdx/types';
11
17
 
12
18
  declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
13
19
 
@@ -1,6 +1,6 @@
1
1
  import { LoaderContext } from 'webpack';
2
- import { W as WebpackLoaderOptions } from '../index-BlVBvy-z.js';
3
- import '../index-D7JdSMpp.js';
2
+ import { W as WebpackLoaderOptions } from '../index-CNOvhtOn.js';
3
+ import '../core-B9ZoS6sA.js';
4
4
  import '@mdx-js/mdx';
5
5
  import '@standard-schema/spec';
6
6
  import 'unified';
@@ -8,6 +8,12 @@ import 'fumadocs-core/mdx-plugins';
8
8
  import 'zod';
9
9
  import 'chokidar';
10
10
  import 'vfile';
11
+ import 'fumadocs-core/source';
12
+ import '../runtime/types.js';
13
+ import 'fumadocs-core/mdx-plugins/remark-structure';
14
+ import 'fumadocs-core/toc';
15
+ import 'mdast';
16
+ import 'mdx/types';
11
17
 
12
18
  declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
13
19
 
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  getCore
3
- } from "../chunk-5UMZCWKV.js";
3
+ } from "../chunk-IQGEFL2B.js";
4
4
  import {
5
5
  createMdxLoader
6
6
  } from "../chunk-6NISOLQ6.js";
7
7
  import {
8
8
  createStandaloneConfigLoader,
9
9
  toWebpack
10
- } from "../chunk-SRSRFOVI.js";
10
+ } from "../chunk-K6HCOGOX.js";
11
11
  import "../chunk-4JSFLXXT.js";
12
- import "../chunk-7L2KNF6B.js";
13
- import "../chunk-PKI7ZDA5.js";
12
+ import "../chunk-BEBCWQC7.js";
13
+ import "../chunk-WBIHDYMN.js";
14
14
  import "../chunk-VWJKRQZR.js";
15
15
 
16
16
  // src/webpack/mdx.ts
@@ -229,10 +229,11 @@ __export(load_from_file_exports, {
229
229
  });
230
230
  async function compileConfig(core2) {
231
231
  const { build } = await import("esbuild");
232
+ const { configPath, outDir } = core2.getOptions();
232
233
  const transformed = await build({
233
- entryPoints: [{ in: core2._options.configPath, out: "source.config" }],
234
+ entryPoints: [{ in: configPath, out: "source.config" }],
234
235
  bundle: true,
235
- outdir: core2._options.outDir,
236
+ outdir: outDir,
236
237
  target: "node20",
237
238
  write: true,
238
239
  platform: "node",
@@ -357,7 +358,7 @@ function createStandaloneConfigLoader({
357
358
  let loaded;
358
359
  async function getConfigHash() {
359
360
  if (mode === "production") return "static";
360
- const stats = await import_promises2.default.stat(core2._options.configPath).catch(() => {
361
+ const stats = await import_promises2.default.stat(core2.getOptions().configPath).catch(() => {
361
362
  throw new Error("Cannot find config file");
362
363
  });
363
364
  return stats.mtime.getTime().toString();
@@ -468,23 +469,13 @@ function createMetaLoader(configLoader, resolve = {}) {
468
469
 
469
470
  // src/core.ts
470
471
  var import_node_path3 = __toESM(require("path"), 1);
471
- var import_promises4 = __toESM(require("fs/promises"), 1);
472
-
473
- // src/utils/codegen/cache.ts
474
- var import_lru_cache = require("lru-cache");
475
472
  var import_promises3 = __toESM(require("fs/promises"), 1);
473
+
474
+ // src/utils/codegen.ts
476
475
  var import_node_path2 = __toESM(require("path"), 1);
477
- var map = new import_lru_cache.LRUCache({
478
- max: 100
479
- });
480
- function toFullPath(file) {
481
- if (import_node_path2.default.isAbsolute(file)) {
482
- return import_node_path2.default.relative(process.cwd(), file);
483
- }
484
- return file;
485
- }
486
- function removeFileCache(file) {
487
- map.delete(toFullPath(file));
476
+ var import_tinyglobby = require("tinyglobby");
477
+ function ident(code, tab = 1) {
478
+ return code.split("\n").map((v) => " ".repeat(tab) + v).join("\n");
488
479
  }
489
480
 
490
481
  // src/core.ts
@@ -516,7 +507,6 @@ function createCore(options, defaultPlugins = []) {
516
507
  return data;
517
508
  }
518
509
  const core2 = {
519
- _options: options,
520
510
  /**
521
511
  * Convenient cache store, reset when config changes
522
512
  */
@@ -525,6 +515,7 @@ function createCore(options, defaultPlugins = []) {
525
515
  config = await newConfig;
526
516
  this.cache.clear();
527
517
  plugins = await getPlugins([
518
+ postprocessPlugin(),
528
519
  ...defaultPlugins,
529
520
  ...config.global.plugins ?? []
530
521
  ]);
@@ -532,7 +523,9 @@ function createCore(options, defaultPlugins = []) {
532
523
  const out = await plugin.config?.call(pluginContext, config);
533
524
  if (out) config = out;
534
525
  }
535
- return this;
526
+ },
527
+ getOptions() {
528
+ return options;
536
529
  },
537
530
  getConfig() {
538
531
  return config;
@@ -543,10 +536,13 @@ function createCore(options, defaultPlugins = []) {
543
536
  getCompiledConfigPath() {
544
537
  return import_node_path3.default.join(options.outDir, "source.config.mjs");
545
538
  },
539
+ getPlugins() {
540
+ return plugins;
541
+ },
542
+ getPluginContext() {
543
+ return pluginContext;
544
+ },
546
545
  async initServer(server) {
547
- server.watcher?.on("all", async (event, file) => {
548
- if (event === "change") removeFileCache(file);
549
- });
550
546
  for (const plugin of plugins) {
551
547
  await plugin.configureServer?.call(pluginContext, server);
552
548
  }
@@ -565,8 +561,8 @@ function createCore(options, defaultPlugins = []) {
565
561
  await Promise.all(
566
562
  out.map(async (entry) => {
567
563
  const file = import_node_path3.default.join(options.outDir, entry.path);
568
- await import_promises4.default.mkdir(import_node_path3.default.dirname(file), { recursive: true });
569
- await import_promises4.default.writeFile(file, entry.content);
564
+ await import_promises3.default.mkdir(import_node_path3.default.dirname(file), { recursive: true });
565
+ await import_promises3.default.writeFile(file, entry.content);
570
566
  })
571
567
  );
572
568
  console.log(`[MDX] generated files in ${performance.now() - start}ms`);
@@ -613,6 +609,45 @@ function createCore(options, defaultPlugins = []) {
613
609
  };
614
610
  return core2;
615
611
  }
612
+ function postprocessPlugin() {
613
+ const LinkReferenceTypes = `{
614
+ /**
615
+ * extracted references (e.g. hrefs, paths), useful for analyzing relationships between pages.
616
+ */
617
+ extractedReferences?: import('fumadocs-mdx').ExtractedReference[];
618
+ }`;
619
+ return {
620
+ "index-file": {
621
+ generateTypeConfig() {
622
+ const lines = [];
623
+ lines.push("{");
624
+ lines.push(" DocData: {");
625
+ for (const collection of this.core.getConfig().collectionList) {
626
+ let postprocessOptions;
627
+ switch (collection.type) {
628
+ case "doc":
629
+ postprocessOptions = collection.postprocess;
630
+ break;
631
+ case "docs":
632
+ postprocessOptions = collection.docs.postprocess;
633
+ break;
634
+ }
635
+ if (postprocessOptions?.extractLinkReferences) {
636
+ lines.push(ident(`${collection.name}: ${LinkReferenceTypes},`, 2));
637
+ }
638
+ }
639
+ lines.push(" }");
640
+ lines.push("}");
641
+ return lines.join("\n");
642
+ },
643
+ serverOptions(options) {
644
+ options.doc ??= {};
645
+ options.doc.passthroughs ??= [];
646
+ options.doc.passthroughs.push("extractedReferences");
647
+ }
648
+ }
649
+ };
650
+ }
616
651
 
617
652
  // src/webpack/index.ts
618
653
  var core;
@@ -1,6 +1,6 @@
1
1
  import { LoaderContext } from 'webpack';
2
- import { W as WebpackLoaderOptions } from '../index-P2NNUkHn.cjs';
3
- import '../index-D7JdSMpp.cjs';
2
+ import { W as WebpackLoaderOptions } from '../index-BD8Woo4m.cjs';
3
+ import '../core-DTuP23zu.cjs';
4
4
  import '@mdx-js/mdx';
5
5
  import '@standard-schema/spec';
6
6
  import 'unified';
@@ -8,6 +8,12 @@ import 'fumadocs-core/mdx-plugins';
8
8
  import 'zod';
9
9
  import 'chokidar';
10
10
  import 'vfile';
11
+ import 'fumadocs-core/source';
12
+ import '../runtime/types.cjs';
13
+ import 'fumadocs-core/mdx-plugins/remark-structure';
14
+ import 'fumadocs-core/toc';
15
+ import 'mdast';
16
+ import 'mdx/types';
11
17
 
12
18
  declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
13
19
 
@@ -1,6 +1,6 @@
1
1
  import { LoaderContext } from 'webpack';
2
- import { W as WebpackLoaderOptions } from '../index-BlVBvy-z.js';
3
- import '../index-D7JdSMpp.js';
2
+ import { W as WebpackLoaderOptions } from '../index-CNOvhtOn.js';
3
+ import '../core-B9ZoS6sA.js';
4
4
  import '@mdx-js/mdx';
5
5
  import '@standard-schema/spec';
6
6
  import 'unified';
@@ -8,6 +8,12 @@ import 'fumadocs-core/mdx-plugins';
8
8
  import 'zod';
9
9
  import 'chokidar';
10
10
  import 'vfile';
11
+ import 'fumadocs-core/source';
12
+ import '../runtime/types.js';
13
+ import 'fumadocs-core/mdx-plugins/remark-structure';
14
+ import 'fumadocs-core/toc';
15
+ import 'mdast';
16
+ import 'mdx/types';
11
17
 
12
18
  declare function loader(this: LoaderContext<WebpackLoaderOptions>, source: string, callback: LoaderContext<WebpackLoaderOptions>['callback']): Promise<void>;
13
19
 
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  getCore
3
- } from "../chunk-5UMZCWKV.js";
3
+ } from "../chunk-IQGEFL2B.js";
4
4
  import {
5
5
  createMetaLoader
6
6
  } from "../chunk-TYJDYTKH.js";
7
7
  import {
8
8
  createStandaloneConfigLoader,
9
9
  toWebpack
10
- } from "../chunk-SRSRFOVI.js";
10
+ } from "../chunk-K6HCOGOX.js";
11
11
  import "../chunk-4JSFLXXT.js";
12
- import "../chunk-7L2KNF6B.js";
13
- import "../chunk-PKI7ZDA5.js";
12
+ import "../chunk-BEBCWQC7.js";
13
+ import "../chunk-WBIHDYMN.js";
14
14
 
15
15
  // src/webpack/meta.ts
16
16
  var instance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-mdx",
3
- "version": "14.0.0",
3
+ "version": "14.0.1",
4
4
  "description": "The built-in source for Fumadocs",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -99,7 +99,7 @@
99
99
  "webpack": "^5.102.1",
100
100
  "@fumadocs/mdx-remote": "1.4.3",
101
101
  "eslint-config-custom": "0.0.0",
102
- "fumadocs-core": "16.0.12",
102
+ "fumadocs-core": "16.0.13",
103
103
  "tsconfig": "0.0.0"
104
104
  },
105
105
  "peerDependencies": {
@@ -1,29 +0,0 @@
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
- };