@powerlines/plugin-rspack 0.5.298 → 0.5.300

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 (114) hide show
  1. package/dist/core/src/lib/logger.mjs +40 -0
  2. package/dist/core/src/lib/logger.mjs.map +1 -0
  3. package/dist/core/src/lib/unplugin/helpers.mjs +19 -0
  4. package/dist/core/src/lib/unplugin/helpers.mjs.map +1 -0
  5. package/dist/core/src/lib/unplugin/index.mjs +5 -0
  6. package/dist/core/src/lib/unplugin/module-resolution.mjs +66 -0
  7. package/dist/core/src/lib/unplugin/module-resolution.mjs.map +1 -0
  8. package/dist/core/src/lib/unplugin/plugin.mjs +71 -0
  9. package/dist/core/src/lib/unplugin/plugin.mjs.map +1 -0
  10. package/dist/core/src/lib/utilities/source-file.mjs +22 -0
  11. package/dist/core/src/lib/utilities/source-file.mjs.map +1 -0
  12. package/dist/core/src/types/api.d.mts +103 -0
  13. package/dist/core/src/types/api.d.mts.map +1 -0
  14. package/dist/core/src/types/commands.d.mts +10 -0
  15. package/dist/core/src/types/commands.d.mts.map +1 -0
  16. package/dist/core/src/types/config.d.mts +551 -0
  17. package/dist/core/src/types/config.d.mts.map +1 -0
  18. package/dist/core/src/types/context.d.mts +511 -0
  19. package/dist/core/src/types/context.d.mts.map +1 -0
  20. package/dist/core/src/types/fs.d.mts +487 -0
  21. package/dist/core/src/types/fs.d.mts.map +1 -0
  22. package/dist/core/src/types/hooks.d.mts +99 -0
  23. package/dist/core/src/types/hooks.d.mts.map +1 -0
  24. package/dist/core/src/types/index.d.mts +9 -0
  25. package/dist/core/src/types/plugin.d.mts +204 -0
  26. package/dist/core/src/types/plugin.d.mts.map +1 -0
  27. package/dist/core/src/types/tsconfig.d.mts +70 -0
  28. package/dist/core/src/types/tsconfig.d.mts.map +1 -0
  29. package/dist/core/src/types/unplugin.d.mts +25 -0
  30. package/dist/core/src/types/unplugin.d.mts.map +1 -0
  31. package/dist/core/src/types/unplugin.mjs +22 -0
  32. package/dist/core/src/types/unplugin.mjs.map +1 -0
  33. package/dist/helpers/index.d.mts +2 -1
  34. package/dist/helpers/index.mjs +2 -1
  35. package/dist/helpers/resolve-options.d.mts +16 -0
  36. package/dist/helpers/resolve-options.d.mts.map +1 -0
  37. package/dist/helpers/resolve-options.mjs +37 -0
  38. package/dist/helpers/resolve-options.mjs.map +1 -0
  39. package/dist/helpers/unplugin.mjs +3 -2
  40. package/dist/helpers/unplugin.mjs.map +1 -1
  41. package/dist/index.d.mts +6 -3
  42. package/dist/index.d.mts.map +1 -1
  43. package/dist/index.mjs +3 -3
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/types/build.d.mts +8 -0
  46. package/dist/types/build.d.mts.map +1 -0
  47. package/dist/types/build.mjs +1 -0
  48. package/dist/types/index.d.mts +3 -2
  49. package/dist/types/plugin.d.mts +13 -6
  50. package/dist/types/plugin.d.mts.map +1 -1
  51. package/package.json +27 -98
  52. package/dist/_virtual/rolldown_runtime.cjs +0 -31
  53. package/dist/_virtual/rolldown_runtime.mjs +0 -32
  54. package/dist/helpers/index.cjs +0 -3
  55. package/dist/helpers/index.d.cts +0 -2
  56. package/dist/helpers/unplugin.cjs +0 -11
  57. package/dist/helpers/unplugin.d.cts +0 -8
  58. package/dist/helpers/unplugin.d.cts.map +0 -1
  59. package/dist/index.cjs +0 -37
  60. package/dist/index.d.cts +0 -14
  61. package/dist/index.d.cts.map +0 -1
  62. package/dist/node_modules/.pnpm/@jridgewell_gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.cjs +0 -2
  63. package/dist/node_modules/.pnpm/@jridgewell_gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs +0 -4
  64. package/dist/node_modules/.pnpm/@jridgewell_remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.cjs +0 -2
  65. package/dist/node_modules/.pnpm/@jridgewell_remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.mjs +0 -4
  66. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +0 -15
  67. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -16
  68. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +0 -1
  69. package/dist/node_modules/.pnpm/@jridgewell_trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.cjs +0 -1
  70. package/dist/node_modules/.pnpm/@jridgewell_trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +0 -3
  71. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.cjs +0 -28
  72. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.mjs +0 -24
  73. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.mjs.map +0 -1
  74. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.cjs +0 -175
  75. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.mjs +0 -171
  76. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.mjs.map +0 -1
  77. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.cjs +0 -871
  78. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.mjs +0 -867
  79. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.mjs.map +0 -1
  80. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.cjs +0 -307
  81. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.mjs +0 -303
  82. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.mjs.map +0 -1
  83. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.cjs +0 -300
  84. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.mjs +0 -296
  85. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.mjs.map +0 -1
  86. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.cjs +0 -60
  87. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.mjs +0 -56
  88. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.mjs.map +0 -1
  89. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/context-CehLHpzV.cjs +0 -46
  90. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/context-CehLHpzV.mjs +0 -45
  91. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/context-CehLHpzV.mjs.map +0 -1
  92. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.cjs +0 -142
  93. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.mjs +0 -141
  94. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.mjs.map +0 -1
  95. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.cjs +0 -114
  96. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.mjs +0 -113
  97. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.mjs.map +0 -1
  98. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/utils-CuyC8gTr.cjs +0 -59
  99. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/utils-CuyC8gTr.mjs +0 -55
  100. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/utils-CuyC8gTr.mjs.map +0 -1
  101. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/webpack-like-BU9ULG6P.cjs +0 -35
  102. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/webpack-like-BU9ULG6P.mjs +0 -34
  103. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/webpack-like-BU9ULG6P.mjs.map +0 -1
  104. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.cjs +0 -236
  105. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.mjs +0 -232
  106. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.mjs.map +0 -1
  107. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/virtual-stats.cjs +0 -54
  108. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/virtual-stats.mjs +0 -50
  109. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/virtual-stats.mjs.map +0 -1
  110. package/dist/types/index.cjs +0 -0
  111. package/dist/types/index.d.cts +0 -2
  112. package/dist/types/plugin.cjs +0 -0
  113. package/dist/types/plugin.d.cts +0 -14
  114. package/dist/types/plugin.d.cts.map +0 -1
@@ -1,59 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
2
- let node_path = require("node:path");
3
- let node_fs = require("node:fs");
4
- node_fs = require_rolldown_runtime.__toESM(node_fs);
5
-
6
- //#region ../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/utils-CuyC8gTr.mjs
7
- function encodeVirtualModuleId(id, plugin) {
8
- return (0, node_path.resolve)(plugin.__virtualModulePrefix, encodeURIComponent(id));
9
- }
10
- function decodeVirtualModuleId(encoded, _plugin) {
11
- return decodeURIComponent((0, node_path.basename)(encoded));
12
- }
13
- function isVirtualModuleId(encoded, plugin) {
14
- return (0, node_path.dirname)(encoded) === plugin.__virtualModulePrefix;
15
- }
16
- var FakeVirtualModulesPlugin = class FakeVirtualModulesPlugin$1 {
17
- name = "FakeVirtualModulesPlugin";
18
- static counters = /* @__PURE__ */ new Map();
19
- static initCleanup = false;
20
- constructor(plugin) {
21
- this.plugin = plugin;
22
- if (!FakeVirtualModulesPlugin$1.initCleanup) {
23
- FakeVirtualModulesPlugin$1.initCleanup = true;
24
- process.once("exit", () => {
25
- FakeVirtualModulesPlugin$1.counters.forEach((_, dir) => {
26
- node_fs.default.rmSync(dir, {
27
- recursive: true,
28
- force: true
29
- });
30
- });
31
- });
32
- }
33
- }
34
- apply(compiler) {
35
- const dir = this.plugin.__virtualModulePrefix;
36
- if (!node_fs.default.existsSync(dir)) node_fs.default.mkdirSync(dir, { recursive: true });
37
- const counter = FakeVirtualModulesPlugin$1.counters.get(dir) ?? 0;
38
- FakeVirtualModulesPlugin$1.counters.set(dir, counter + 1);
39
- compiler.hooks.shutdown.tap(this.name, () => {
40
- const counter$1 = (FakeVirtualModulesPlugin$1.counters.get(dir) ?? 1) - 1;
41
- if (counter$1 === 0) {
42
- FakeVirtualModulesPlugin$1.counters.delete(dir);
43
- node_fs.default.rmSync(dir, {
44
- recursive: true,
45
- force: true
46
- });
47
- } else FakeVirtualModulesPlugin$1.counters.set(dir, counter$1);
48
- });
49
- }
50
- async writeModule(file) {
51
- return node_fs.default.promises.writeFile(file, "");
52
- }
53
- };
54
-
55
- //#endregion
56
- exports.FakeVirtualModulesPlugin = FakeVirtualModulesPlugin;
57
- exports.decodeVirtualModuleId = decodeVirtualModuleId;
58
- exports.encodeVirtualModuleId = encodeVirtualModuleId;
59
- exports.isVirtualModuleId = isVirtualModuleId;
@@ -1,55 +0,0 @@
1
- import { basename, dirname, resolve } from "node:path";
2
- import fs from "node:fs";
3
-
4
- //#region ../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/utils-CuyC8gTr.mjs
5
- function encodeVirtualModuleId(id, plugin) {
6
- return resolve(plugin.__virtualModulePrefix, encodeURIComponent(id));
7
- }
8
- function decodeVirtualModuleId(encoded, _plugin) {
9
- return decodeURIComponent(basename(encoded));
10
- }
11
- function isVirtualModuleId(encoded, plugin) {
12
- return dirname(encoded) === plugin.__virtualModulePrefix;
13
- }
14
- var FakeVirtualModulesPlugin = class FakeVirtualModulesPlugin$1 {
15
- name = "FakeVirtualModulesPlugin";
16
- static counters = /* @__PURE__ */ new Map();
17
- static initCleanup = false;
18
- constructor(plugin) {
19
- this.plugin = plugin;
20
- if (!FakeVirtualModulesPlugin$1.initCleanup) {
21
- FakeVirtualModulesPlugin$1.initCleanup = true;
22
- process.once("exit", () => {
23
- FakeVirtualModulesPlugin$1.counters.forEach((_, dir) => {
24
- fs.rmSync(dir, {
25
- recursive: true,
26
- force: true
27
- });
28
- });
29
- });
30
- }
31
- }
32
- apply(compiler) {
33
- const dir = this.plugin.__virtualModulePrefix;
34
- if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
35
- const counter = FakeVirtualModulesPlugin$1.counters.get(dir) ?? 0;
36
- FakeVirtualModulesPlugin$1.counters.set(dir, counter + 1);
37
- compiler.hooks.shutdown.tap(this.name, () => {
38
- const counter$1 = (FakeVirtualModulesPlugin$1.counters.get(dir) ?? 1) - 1;
39
- if (counter$1 === 0) {
40
- FakeVirtualModulesPlugin$1.counters.delete(dir);
41
- fs.rmSync(dir, {
42
- recursive: true,
43
- force: true
44
- });
45
- } else FakeVirtualModulesPlugin$1.counters.set(dir, counter$1);
46
- });
47
- }
48
- async writeModule(file) {
49
- return fs.promises.writeFile(file, "");
50
- }
51
- };
52
-
53
- //#endregion
54
- export { FakeVirtualModulesPlugin, decodeVirtualModuleId, encodeVirtualModuleId, isVirtualModuleId };
55
- //# sourceMappingURL=utils-CuyC8gTr.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils-CuyC8gTr.mjs","names":["FakeVirtualModulesPlugin"],"sources":["../../../../../../../../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/utils-CuyC8gTr.mjs"],"sourcesContent":["import { basename, dirname, resolve } from \"node:path\";\nimport fs from \"node:fs\";\n\n//#region src/rspack/utils.ts\nfunction encodeVirtualModuleId(id, plugin) {\n\treturn resolve(plugin.__virtualModulePrefix, encodeURIComponent(id));\n}\nfunction decodeVirtualModuleId(encoded, _plugin) {\n\treturn decodeURIComponent(basename(encoded));\n}\nfunction isVirtualModuleId(encoded, plugin) {\n\treturn dirname(encoded) === plugin.__virtualModulePrefix;\n}\nvar FakeVirtualModulesPlugin = class FakeVirtualModulesPlugin {\n\tname = \"FakeVirtualModulesPlugin\";\n\tstatic counters = /* @__PURE__ */ new Map();\n\tstatic initCleanup = false;\n\tconstructor(plugin) {\n\t\tthis.plugin = plugin;\n\t\tif (!FakeVirtualModulesPlugin.initCleanup) {\n\t\t\tFakeVirtualModulesPlugin.initCleanup = true;\n\t\t\tprocess.once(\"exit\", () => {\n\t\t\t\tFakeVirtualModulesPlugin.counters.forEach((_, dir) => {\n\t\t\t\t\tfs.rmSync(dir, {\n\t\t\t\t\t\trecursive: true,\n\t\t\t\t\t\tforce: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\tapply(compiler) {\n\t\tconst dir = this.plugin.__virtualModulePrefix;\n\t\tif (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });\n\t\tconst counter = FakeVirtualModulesPlugin.counters.get(dir) ?? 0;\n\t\tFakeVirtualModulesPlugin.counters.set(dir, counter + 1);\n\t\tcompiler.hooks.shutdown.tap(this.name, () => {\n\t\t\tconst counter$1 = (FakeVirtualModulesPlugin.counters.get(dir) ?? 1) - 1;\n\t\t\tif (counter$1 === 0) {\n\t\t\t\tFakeVirtualModulesPlugin.counters.delete(dir);\n\t\t\t\tfs.rmSync(dir, {\n\t\t\t\t\trecursive: true,\n\t\t\t\t\tforce: true\n\t\t\t\t});\n\t\t\t} else FakeVirtualModulesPlugin.counters.set(dir, counter$1);\n\t\t});\n\t}\n\tasync writeModule(file) {\n\t\treturn fs.promises.writeFile(file, \"\");\n\t}\n};\n\n//#endregion\nexport { isVirtualModuleId as i, decodeVirtualModuleId as n, encodeVirtualModuleId as r, FakeVirtualModulesPlugin as t };"],"x_google_ignoreList":[0],"mappings":";;;;AAIA,SAAS,sBAAsB,IAAI,QAAQ;AAC1C,QAAO,QAAQ,OAAO,uBAAuB,mBAAmB,GAAG,CAAC;;AAErE,SAAS,sBAAsB,SAAS,SAAS;AAChD,QAAO,mBAAmB,SAAS,QAAQ,CAAC;;AAE7C,SAAS,kBAAkB,SAAS,QAAQ;AAC3C,QAAO,QAAQ,QAAQ,KAAK,OAAO;;AAEpC,IAAI,2BAA2B,MAAMA,2BAAyB;CAC7D,OAAO;CACP,OAAO,2BAA2B,IAAI,KAAK;CAC3C,OAAO,cAAc;CACrB,YAAY,QAAQ;AACnB,OAAK,SAAS;AACd,MAAI,CAACA,2BAAyB,aAAa;AAC1C,8BAAyB,cAAc;AACvC,WAAQ,KAAK,cAAc;AAC1B,+BAAyB,SAAS,SAAS,GAAG,QAAQ;AACrD,QAAG,OAAO,KAAK;MACd,WAAW;MACX,OAAO;MACP,CAAC;MACD;KACD;;;CAGJ,MAAM,UAAU;EACf,MAAM,MAAM,KAAK,OAAO;AACxB,MAAI,CAAC,GAAG,WAAW,IAAI,CAAE,IAAG,UAAU,KAAK,EAAE,WAAW,MAAM,CAAC;EAC/D,MAAM,UAAUA,2BAAyB,SAAS,IAAI,IAAI,IAAI;AAC9D,6BAAyB,SAAS,IAAI,KAAK,UAAU,EAAE;AACvD,WAAS,MAAM,SAAS,IAAI,KAAK,YAAY;GAC5C,MAAM,aAAaA,2BAAyB,SAAS,IAAI,IAAI,IAAI,KAAK;AACtE,OAAI,cAAc,GAAG;AACpB,+BAAyB,SAAS,OAAO,IAAI;AAC7C,OAAG,OAAO,KAAK;KACd,WAAW;KACX,OAAO;KACP,CAAC;SACI,4BAAyB,SAAS,IAAI,KAAK,UAAU;IAC3D;;CAEH,MAAM,YAAY,MAAM;AACvB,SAAO,GAAG,SAAS,UAAU,MAAM,GAAG"}
@@ -1,35 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
2
- const require_parse_CRORloGP = require('./parse-CRORloGP.cjs');
3
- let node_path = require("node:path");
4
-
5
- //#region ../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/webpack-like-BU9ULG6P.mjs
6
- function transformUse(data, plugin, transformLoader) {
7
- if (data.resource == null) return [];
8
- const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || ""));
9
- if (plugin.transformInclude && !plugin.transformInclude(id)) return [];
10
- const { filter } = require_parse_CRORloGP.normalizeObjectHook("load", plugin.transform);
11
- if (!filter(id)) return [];
12
- return [{
13
- loader: transformLoader,
14
- options: { plugin },
15
- ident: plugin.name
16
- }];
17
- }
18
- /**
19
- * Normalizes a given path when it's absolute. Normalizing means returning a new path by converting
20
- * the input path to the native os format. This is useful in cases where we want to normalize
21
- * the `id` argument of a hook. Any absolute ids should be in the default format
22
- * of the operating system. Any relative imports or node_module imports should remain
23
- * untouched.
24
- *
25
- * @param path - Path to normalize.
26
- * @returns a new normalized path.
27
- */
28
- function normalizeAbsolutePath(path$1) {
29
- if ((0, node_path.isAbsolute)(path$1)) return (0, node_path.normalize)(path$1);
30
- else return path$1;
31
- }
32
-
33
- //#endregion
34
- exports.normalizeAbsolutePath = normalizeAbsolutePath;
35
- exports.transformUse = transformUse;
@@ -1,34 +0,0 @@
1
- import { normalizeObjectHook } from "./parse-CRORloGP.mjs";
2
- import { isAbsolute, normalize } from "node:path";
3
-
4
- //#region ../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/webpack-like-BU9ULG6P.mjs
5
- function transformUse(data, plugin, transformLoader) {
6
- if (data.resource == null) return [];
7
- const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || ""));
8
- if (plugin.transformInclude && !plugin.transformInclude(id)) return [];
9
- const { filter } = normalizeObjectHook("load", plugin.transform);
10
- if (!filter(id)) return [];
11
- return [{
12
- loader: transformLoader,
13
- options: { plugin },
14
- ident: plugin.name
15
- }];
16
- }
17
- /**
18
- * Normalizes a given path when it's absolute. Normalizing means returning a new path by converting
19
- * the input path to the native os format. This is useful in cases where we want to normalize
20
- * the `id` argument of a hook. Any absolute ids should be in the default format
21
- * of the operating system. Any relative imports or node_module imports should remain
22
- * untouched.
23
- *
24
- * @param path - Path to normalize.
25
- * @returns a new normalized path.
26
- */
27
- function normalizeAbsolutePath(path$1) {
28
- if (isAbsolute(path$1)) return normalize(path$1);
29
- else return path$1;
30
- }
31
-
32
- //#endregion
33
- export { normalizeAbsolutePath, transformUse };
34
- //# sourceMappingURL=webpack-like-BU9ULG6P.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webpack-like-BU9ULG6P.mjs","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/webpack-like-BU9ULG6P.mjs"],"sourcesContent":["import { r as normalizeObjectHook } from \"./parse-CRORloGP.mjs\";\nimport { isAbsolute, normalize } from \"node:path\";\n\n//#region src/utils/webpack-like.ts\nfunction transformUse(data, plugin, transformLoader) {\n\tif (data.resource == null) return [];\n\tconst id = normalizeAbsolutePath(data.resource + (data.resourceQuery || \"\"));\n\tif (plugin.transformInclude && !plugin.transformInclude(id)) return [];\n\tconst { filter } = normalizeObjectHook(\"load\", plugin.transform);\n\tif (!filter(id)) return [];\n\treturn [{\n\t\tloader: transformLoader,\n\t\toptions: { plugin },\n\t\tident: plugin.name\n\t}];\n}\n/**\n* Normalizes a given path when it's absolute. Normalizing means returning a new path by converting\n* the input path to the native os format. This is useful in cases where we want to normalize\n* the `id` argument of a hook. Any absolute ids should be in the default format\n* of the operating system. Any relative imports or node_module imports should remain\n* untouched.\n*\n* @param path - Path to normalize.\n* @returns a new normalized path.\n*/\nfunction normalizeAbsolutePath(path$1) {\n\tif (isAbsolute(path$1)) return normalize(path$1);\n\telse return path$1;\n}\n\n//#endregion\nexport { transformUse as n, normalizeAbsolutePath as t };"],"x_google_ignoreList":[0],"mappings":";;;;AAIA,SAAS,aAAa,MAAM,QAAQ,iBAAiB;AACpD,KAAI,KAAK,YAAY,KAAM,QAAO,EAAE;CACpC,MAAM,KAAK,sBAAsB,KAAK,YAAY,KAAK,iBAAiB,IAAI;AAC5E,KAAI,OAAO,oBAAoB,CAAC,OAAO,iBAAiB,GAAG,CAAE,QAAO,EAAE;CACtE,MAAM,EAAE,WAAW,oBAAoB,QAAQ,OAAO,UAAU;AAChE,KAAI,CAAC,OAAO,GAAG,CAAE,QAAO,EAAE;AAC1B,QAAO,CAAC;EACP,QAAQ;EACR,SAAS,EAAE,QAAQ;EACnB,OAAO,OAAO;EACd,CAAC;;;;;;;;;;;;AAYH,SAAS,sBAAsB,QAAQ;AACtC,KAAI,WAAW,OAAO,CAAE,QAAO,UAAU,OAAO;KAC3C,QAAO"}
@@ -1,236 +0,0 @@
1
- "use strict";
2
-
3
- const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
4
- const require_virtual_stats$1 = require('./virtual-stats.cjs');
5
-
6
- //#region ../../node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.js
7
- var require_lib = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
8
- const path_1 = (exports && exports.__importDefault || function(mod) {
9
- return mod && mod.__esModule ? mod : { "default": mod };
10
- })(require("node:path"));
11
- const virtual_stats_1 = require_virtual_stats$1.default;
12
- let inode = 45e6;
13
- const ALL = "all";
14
- const STATIC = "static";
15
- const DYNAMIC = "dynamic";
16
- function checkActivation(instance) {
17
- if (!instance._compiler) throw new Error("You must use this plugin only after creating webpack instance!");
18
- }
19
- function getModulePath(filePath, compiler) {
20
- return path_1.default.isAbsolute(filePath) ? filePath : path_1.default.join(compiler.context, filePath);
21
- }
22
- function createWebpackData(result) {
23
- return (backendOrStorage) => {
24
- if (backendOrStorage._data) {
25
- const curLevelIdx = backendOrStorage._currentLevel;
26
- return {
27
- result,
28
- level: backendOrStorage._levels[curLevelIdx]
29
- };
30
- }
31
- return [null, result];
32
- };
33
- }
34
- function getData(storage, key) {
35
- if (storage._data instanceof Map) return storage._data.get(key);
36
- else if (storage._data) return storage.data[key];
37
- else if (storage.data instanceof Map) return storage.data.get(key);
38
- else return storage.data[key];
39
- }
40
- function setData(backendOrStorage, key, valueFactory) {
41
- const value = valueFactory(backendOrStorage);
42
- if (backendOrStorage._data instanceof Map) backendOrStorage._data.set(key, value);
43
- else if (backendOrStorage._data) backendOrStorage.data[key] = value;
44
- else if (backendOrStorage.data instanceof Map) backendOrStorage.data.set(key, value);
45
- else backendOrStorage.data[key] = value;
46
- }
47
- function getStatStorage(fileSystem) {
48
- if (fileSystem._statStorage) return fileSystem._statStorage;
49
- else if (fileSystem._statBackend) return fileSystem._statBackend;
50
- else throw new Error("Couldn't find a stat storage");
51
- }
52
- function getFileStorage(fileSystem) {
53
- if (fileSystem._readFileStorage) return fileSystem._readFileStorage;
54
- else if (fileSystem._readFileBackend) return fileSystem._readFileBackend;
55
- else throw new Error("Couldn't find a readFileStorage");
56
- }
57
- function getReadDirBackend(fileSystem) {
58
- if (fileSystem._readdirBackend) return fileSystem._readdirBackend;
59
- else if (fileSystem._readdirStorage) return fileSystem._readdirStorage;
60
- else throw new Error("Couldn't find a readDirStorage from Webpack Internals");
61
- }
62
- function getRealpathBackend(fileSystem) {
63
- if (fileSystem._realpathBackend) return fileSystem._realpathBackend;
64
- }
65
- var VirtualModulesPlugin = class {
66
- constructor(modules) {
67
- this._compiler = null;
68
- this._watcher = null;
69
- this._staticModules = modules || null;
70
- }
71
- getModuleList(filter = ALL) {
72
- var _a, _b;
73
- let modules = {};
74
- const shouldGetStaticModules = filter === ALL || filter === STATIC;
75
- const shouldGetDynamicModules = filter === ALL || filter === DYNAMIC;
76
- if (shouldGetStaticModules) modules = Object.assign(Object.assign({}, modules), this._staticModules);
77
- if (shouldGetDynamicModules) {
78
- const finalInputFileSystem = (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.inputFileSystem;
79
- const virtualFiles = (_b = finalInputFileSystem === null || finalInputFileSystem === void 0 ? void 0 : finalInputFileSystem._virtualFiles) !== null && _b !== void 0 ? _b : {};
80
- const dynamicModules = {};
81
- Object.keys(virtualFiles).forEach((key) => {
82
- dynamicModules[key] = virtualFiles[key].contents;
83
- });
84
- modules = Object.assign(Object.assign({}, modules), dynamicModules);
85
- }
86
- return modules;
87
- }
88
- writeModule(filePath, contents) {
89
- if (!this._compiler) throw new Error(`Plugin has not been initialized`);
90
- checkActivation(this);
91
- const len = contents ? contents.length : 0;
92
- const time = Date.now();
93
- const date = new Date(time);
94
- const stats = new virtual_stats_1.VirtualStats({
95
- dev: 8675309,
96
- nlink: 0,
97
- uid: 1e3,
98
- gid: 1e3,
99
- rdev: 0,
100
- blksize: 4096,
101
- ino: inode++,
102
- mode: 33188,
103
- size: len,
104
- blocks: Math.floor(len / 4096),
105
- atime: date,
106
- mtime: date,
107
- ctime: date,
108
- birthtime: date
109
- });
110
- const modulePath = getModulePath(filePath, this._compiler);
111
- if (process.env.WVM_DEBUG) console.log(this._compiler.name, "Write virtual module:", modulePath, contents);
112
- let finalWatchFileSystem = this._watcher && this._watcher.watchFileSystem;
113
- while (finalWatchFileSystem && finalWatchFileSystem.wfs) finalWatchFileSystem = finalWatchFileSystem.wfs;
114
- let finalInputFileSystem = this._compiler.inputFileSystem;
115
- while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) finalInputFileSystem = finalInputFileSystem._inputFileSystem;
116
- finalInputFileSystem._writeVirtualFile(modulePath, stats, contents);
117
- if (finalWatchFileSystem && finalWatchFileSystem.watcher && (finalWatchFileSystem.watcher.fileWatchers.size || finalWatchFileSystem.watcher.fileWatchers.length)) {
118
- const fileWatchers = finalWatchFileSystem.watcher.fileWatchers instanceof Map ? Array.from(finalWatchFileSystem.watcher.fileWatchers.values()) : finalWatchFileSystem.watcher.fileWatchers;
119
- for (let fileWatcher of fileWatchers) {
120
- if ("watcher" in fileWatcher) fileWatcher = fileWatcher.watcher;
121
- if (fileWatcher.path === modulePath) {
122
- if (process.env.DEBUG) console.log(this._compiler.name, "Emit file change:", modulePath, time);
123
- delete fileWatcher.directoryWatcher._cachedTimeInfoEntries;
124
- fileWatcher.emit("change", time, null);
125
- }
126
- }
127
- }
128
- }
129
- apply(compiler) {
130
- this._compiler = compiler;
131
- const afterEnvironmentHook = () => {
132
- let finalInputFileSystem = compiler.inputFileSystem;
133
- while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) finalInputFileSystem = finalInputFileSystem._inputFileSystem;
134
- if (!finalInputFileSystem._writeVirtualFile) {
135
- const originalPurge = finalInputFileSystem.purge;
136
- finalInputFileSystem.purge = () => {
137
- originalPurge.apply(finalInputFileSystem, []);
138
- if (finalInputFileSystem._virtualFiles) Object.keys(finalInputFileSystem._virtualFiles).forEach((file) => {
139
- const data = finalInputFileSystem._virtualFiles[file];
140
- finalInputFileSystem._writeVirtualFile(file, data.stats, data.contents);
141
- });
142
- };
143
- finalInputFileSystem._writeVirtualFile = (file, stats, contents) => {
144
- const statStorage = getStatStorage(finalInputFileSystem);
145
- const fileStorage = getFileStorage(finalInputFileSystem);
146
- const readDirStorage = getReadDirBackend(finalInputFileSystem);
147
- const realPathStorage = getRealpathBackend(finalInputFileSystem);
148
- finalInputFileSystem._virtualFiles = finalInputFileSystem._virtualFiles || {};
149
- finalInputFileSystem._virtualFiles[file] = {
150
- stats,
151
- contents
152
- };
153
- setData(statStorage, file, createWebpackData(stats));
154
- setData(fileStorage, file, createWebpackData(contents));
155
- const segments = file.split(/[\\/]/);
156
- let count = segments.length - 1;
157
- const minCount = segments[0] ? 1 : 0;
158
- while (count > minCount) {
159
- const dir = segments.slice(0, count).join(path_1.default.sep) || path_1.default.sep;
160
- try {
161
- finalInputFileSystem.readdirSync(dir);
162
- } catch (e) {
163
- const time = Date.now();
164
- const dirStats = new virtual_stats_1.VirtualStats({
165
- dev: 8675309,
166
- nlink: 0,
167
- uid: 1e3,
168
- gid: 1e3,
169
- rdev: 0,
170
- blksize: 4096,
171
- ino: inode++,
172
- mode: 16877,
173
- size: stats.size,
174
- blocks: Math.floor(stats.size / 4096),
175
- atime: time,
176
- mtime: time,
177
- ctime: time,
178
- birthtime: time
179
- });
180
- setData(readDirStorage, dir, createWebpackData([]));
181
- if (realPathStorage) setData(realPathStorage, dir, createWebpackData(dir));
182
- setData(statStorage, dir, createWebpackData(dirStats));
183
- }
184
- let dirData = getData(getReadDirBackend(finalInputFileSystem), dir);
185
- dirData = dirData[1] || dirData.result;
186
- const filename = segments[count];
187
- if (dirData.indexOf(filename) < 0) {
188
- const files = dirData.concat([filename]).sort();
189
- setData(getReadDirBackend(finalInputFileSystem), dir, createWebpackData(files));
190
- } else break;
191
- count--;
192
- }
193
- };
194
- }
195
- };
196
- const afterResolversHook = () => {
197
- if (this._staticModules) {
198
- for (const [filePath, contents] of Object.entries(this._staticModules)) this.writeModule(filePath, contents);
199
- this._staticModules = null;
200
- }
201
- };
202
- const version = typeof compiler.webpack === "undefined" ? 4 : 5;
203
- const watchRunHook = (watcher, callback) => {
204
- this._watcher = watcher.compiler || watcher;
205
- const virtualFiles = compiler.inputFileSystem._virtualFiles;
206
- const fts = compiler.fileTimestamps;
207
- if (virtualFiles && fts && typeof fts.set === "function") Object.keys(virtualFiles).forEach((file) => {
208
- const mtime = +virtualFiles[file].stats.mtime;
209
- fts.set(file, version === 4 ? mtime : {
210
- safeTime: mtime,
211
- timestamp: mtime
212
- });
213
- });
214
- callback();
215
- };
216
- if (compiler.hooks) {
217
- compiler.hooks.afterEnvironment.tap("VirtualModulesPlugin", afterEnvironmentHook);
218
- compiler.hooks.afterResolvers.tap("VirtualModulesPlugin", afterResolversHook);
219
- compiler.hooks.watchRun.tapAsync("VirtualModulesPlugin", watchRunHook);
220
- } else {
221
- compiler.plugin("after-environment", afterEnvironmentHook);
222
- compiler.plugin("after-resolvers", afterResolversHook);
223
- compiler.plugin("watch-run", watchRunHook);
224
- }
225
- }
226
- };
227
- module.exports = VirtualModulesPlugin;
228
- }));
229
-
230
- //#endregion
231
- Object.defineProperty(exports, 'default', {
232
- enumerable: true,
233
- get: function () {
234
- return require_lib();
235
- }
236
- });
@@ -1,232 +0,0 @@
1
- import { __commonJSMin, __require } from "../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_virtual_stats } from "./virtual-stats.mjs";
3
-
4
- //#region ../../node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.js
5
- var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6
- const path_1 = (exports && exports.__importDefault || function(mod) {
7
- return mod && mod.__esModule ? mod : { "default": mod };
8
- })(__require("node:path"));
9
- const virtual_stats_1 = require_virtual_stats();
10
- let inode = 45e6;
11
- const ALL = "all";
12
- const STATIC = "static";
13
- const DYNAMIC = "dynamic";
14
- function checkActivation(instance) {
15
- if (!instance._compiler) throw new Error("You must use this plugin only after creating webpack instance!");
16
- }
17
- function getModulePath(filePath, compiler) {
18
- return path_1.default.isAbsolute(filePath) ? filePath : path_1.default.join(compiler.context, filePath);
19
- }
20
- function createWebpackData(result) {
21
- return (backendOrStorage) => {
22
- if (backendOrStorage._data) {
23
- const curLevelIdx = backendOrStorage._currentLevel;
24
- return {
25
- result,
26
- level: backendOrStorage._levels[curLevelIdx]
27
- };
28
- }
29
- return [null, result];
30
- };
31
- }
32
- function getData(storage, key) {
33
- if (storage._data instanceof Map) return storage._data.get(key);
34
- else if (storage._data) return storage.data[key];
35
- else if (storage.data instanceof Map) return storage.data.get(key);
36
- else return storage.data[key];
37
- }
38
- function setData(backendOrStorage, key, valueFactory) {
39
- const value = valueFactory(backendOrStorage);
40
- if (backendOrStorage._data instanceof Map) backendOrStorage._data.set(key, value);
41
- else if (backendOrStorage._data) backendOrStorage.data[key] = value;
42
- else if (backendOrStorage.data instanceof Map) backendOrStorage.data.set(key, value);
43
- else backendOrStorage.data[key] = value;
44
- }
45
- function getStatStorage(fileSystem) {
46
- if (fileSystem._statStorage) return fileSystem._statStorage;
47
- else if (fileSystem._statBackend) return fileSystem._statBackend;
48
- else throw new Error("Couldn't find a stat storage");
49
- }
50
- function getFileStorage(fileSystem) {
51
- if (fileSystem._readFileStorage) return fileSystem._readFileStorage;
52
- else if (fileSystem._readFileBackend) return fileSystem._readFileBackend;
53
- else throw new Error("Couldn't find a readFileStorage");
54
- }
55
- function getReadDirBackend(fileSystem) {
56
- if (fileSystem._readdirBackend) return fileSystem._readdirBackend;
57
- else if (fileSystem._readdirStorage) return fileSystem._readdirStorage;
58
- else throw new Error("Couldn't find a readDirStorage from Webpack Internals");
59
- }
60
- function getRealpathBackend(fileSystem) {
61
- if (fileSystem._realpathBackend) return fileSystem._realpathBackend;
62
- }
63
- var VirtualModulesPlugin = class {
64
- constructor(modules) {
65
- this._compiler = null;
66
- this._watcher = null;
67
- this._staticModules = modules || null;
68
- }
69
- getModuleList(filter = ALL) {
70
- var _a, _b;
71
- let modules = {};
72
- const shouldGetStaticModules = filter === ALL || filter === STATIC;
73
- const shouldGetDynamicModules = filter === ALL || filter === DYNAMIC;
74
- if (shouldGetStaticModules) modules = Object.assign(Object.assign({}, modules), this._staticModules);
75
- if (shouldGetDynamicModules) {
76
- const finalInputFileSystem = (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.inputFileSystem;
77
- const virtualFiles = (_b = finalInputFileSystem === null || finalInputFileSystem === void 0 ? void 0 : finalInputFileSystem._virtualFiles) !== null && _b !== void 0 ? _b : {};
78
- const dynamicModules = {};
79
- Object.keys(virtualFiles).forEach((key) => {
80
- dynamicModules[key] = virtualFiles[key].contents;
81
- });
82
- modules = Object.assign(Object.assign({}, modules), dynamicModules);
83
- }
84
- return modules;
85
- }
86
- writeModule(filePath, contents) {
87
- if (!this._compiler) throw new Error(`Plugin has not been initialized`);
88
- checkActivation(this);
89
- const len = contents ? contents.length : 0;
90
- const time = Date.now();
91
- const date = new Date(time);
92
- const stats = new virtual_stats_1.VirtualStats({
93
- dev: 8675309,
94
- nlink: 0,
95
- uid: 1e3,
96
- gid: 1e3,
97
- rdev: 0,
98
- blksize: 4096,
99
- ino: inode++,
100
- mode: 33188,
101
- size: len,
102
- blocks: Math.floor(len / 4096),
103
- atime: date,
104
- mtime: date,
105
- ctime: date,
106
- birthtime: date
107
- });
108
- const modulePath = getModulePath(filePath, this._compiler);
109
- if (process.env.WVM_DEBUG) console.log(this._compiler.name, "Write virtual module:", modulePath, contents);
110
- let finalWatchFileSystem = this._watcher && this._watcher.watchFileSystem;
111
- while (finalWatchFileSystem && finalWatchFileSystem.wfs) finalWatchFileSystem = finalWatchFileSystem.wfs;
112
- let finalInputFileSystem = this._compiler.inputFileSystem;
113
- while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) finalInputFileSystem = finalInputFileSystem._inputFileSystem;
114
- finalInputFileSystem._writeVirtualFile(modulePath, stats, contents);
115
- if (finalWatchFileSystem && finalWatchFileSystem.watcher && (finalWatchFileSystem.watcher.fileWatchers.size || finalWatchFileSystem.watcher.fileWatchers.length)) {
116
- const fileWatchers = finalWatchFileSystem.watcher.fileWatchers instanceof Map ? Array.from(finalWatchFileSystem.watcher.fileWatchers.values()) : finalWatchFileSystem.watcher.fileWatchers;
117
- for (let fileWatcher of fileWatchers) {
118
- if ("watcher" in fileWatcher) fileWatcher = fileWatcher.watcher;
119
- if (fileWatcher.path === modulePath) {
120
- if (process.env.DEBUG) console.log(this._compiler.name, "Emit file change:", modulePath, time);
121
- delete fileWatcher.directoryWatcher._cachedTimeInfoEntries;
122
- fileWatcher.emit("change", time, null);
123
- }
124
- }
125
- }
126
- }
127
- apply(compiler) {
128
- this._compiler = compiler;
129
- const afterEnvironmentHook = () => {
130
- let finalInputFileSystem = compiler.inputFileSystem;
131
- while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) finalInputFileSystem = finalInputFileSystem._inputFileSystem;
132
- if (!finalInputFileSystem._writeVirtualFile) {
133
- const originalPurge = finalInputFileSystem.purge;
134
- finalInputFileSystem.purge = () => {
135
- originalPurge.apply(finalInputFileSystem, []);
136
- if (finalInputFileSystem._virtualFiles) Object.keys(finalInputFileSystem._virtualFiles).forEach((file) => {
137
- const data = finalInputFileSystem._virtualFiles[file];
138
- finalInputFileSystem._writeVirtualFile(file, data.stats, data.contents);
139
- });
140
- };
141
- finalInputFileSystem._writeVirtualFile = (file, stats, contents) => {
142
- const statStorage = getStatStorage(finalInputFileSystem);
143
- const fileStorage = getFileStorage(finalInputFileSystem);
144
- const readDirStorage = getReadDirBackend(finalInputFileSystem);
145
- const realPathStorage = getRealpathBackend(finalInputFileSystem);
146
- finalInputFileSystem._virtualFiles = finalInputFileSystem._virtualFiles || {};
147
- finalInputFileSystem._virtualFiles[file] = {
148
- stats,
149
- contents
150
- };
151
- setData(statStorage, file, createWebpackData(stats));
152
- setData(fileStorage, file, createWebpackData(contents));
153
- const segments = file.split(/[\\/]/);
154
- let count = segments.length - 1;
155
- const minCount = segments[0] ? 1 : 0;
156
- while (count > minCount) {
157
- const dir = segments.slice(0, count).join(path_1.default.sep) || path_1.default.sep;
158
- try {
159
- finalInputFileSystem.readdirSync(dir);
160
- } catch (e) {
161
- const time = Date.now();
162
- const dirStats = new virtual_stats_1.VirtualStats({
163
- dev: 8675309,
164
- nlink: 0,
165
- uid: 1e3,
166
- gid: 1e3,
167
- rdev: 0,
168
- blksize: 4096,
169
- ino: inode++,
170
- mode: 16877,
171
- size: stats.size,
172
- blocks: Math.floor(stats.size / 4096),
173
- atime: time,
174
- mtime: time,
175
- ctime: time,
176
- birthtime: time
177
- });
178
- setData(readDirStorage, dir, createWebpackData([]));
179
- if (realPathStorage) setData(realPathStorage, dir, createWebpackData(dir));
180
- setData(statStorage, dir, createWebpackData(dirStats));
181
- }
182
- let dirData = getData(getReadDirBackend(finalInputFileSystem), dir);
183
- dirData = dirData[1] || dirData.result;
184
- const filename = segments[count];
185
- if (dirData.indexOf(filename) < 0) {
186
- const files = dirData.concat([filename]).sort();
187
- setData(getReadDirBackend(finalInputFileSystem), dir, createWebpackData(files));
188
- } else break;
189
- count--;
190
- }
191
- };
192
- }
193
- };
194
- const afterResolversHook = () => {
195
- if (this._staticModules) {
196
- for (const [filePath, contents] of Object.entries(this._staticModules)) this.writeModule(filePath, contents);
197
- this._staticModules = null;
198
- }
199
- };
200
- const version = typeof compiler.webpack === "undefined" ? 4 : 5;
201
- const watchRunHook = (watcher, callback) => {
202
- this._watcher = watcher.compiler || watcher;
203
- const virtualFiles = compiler.inputFileSystem._virtualFiles;
204
- const fts = compiler.fileTimestamps;
205
- if (virtualFiles && fts && typeof fts.set === "function") Object.keys(virtualFiles).forEach((file) => {
206
- const mtime = +virtualFiles[file].stats.mtime;
207
- fts.set(file, version === 4 ? mtime : {
208
- safeTime: mtime,
209
- timestamp: mtime
210
- });
211
- });
212
- callback();
213
- };
214
- if (compiler.hooks) {
215
- compiler.hooks.afterEnvironment.tap("VirtualModulesPlugin", afterEnvironmentHook);
216
- compiler.hooks.afterResolvers.tap("VirtualModulesPlugin", afterResolversHook);
217
- compiler.hooks.watchRun.tapAsync("VirtualModulesPlugin", watchRunHook);
218
- } else {
219
- compiler.plugin("after-environment", afterEnvironmentHook);
220
- compiler.plugin("after-resolvers", afterResolversHook);
221
- compiler.plugin("watch-run", watchRunHook);
222
- }
223
- }
224
- };
225
- module.exports = VirtualModulesPlugin;
226
- }));
227
-
228
- //#endregion
229
- export default require_lib();
230
-
231
- export { require_lib };
232
- //# sourceMappingURL=index.mjs.map