@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,142 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
2
- const require_parse_CRORloGP = require('./parse-CRORloGP.cjs');
3
- const require_webpack_like_BU9ULG6P = require('./webpack-like-BU9ULG6P.cjs');
4
- const require_context_CehLHpzV = require('./context-CehLHpzV.cjs');
5
- const require_utils_CuyC8gTr = require('./utils-CuyC8gTr.cjs');
6
- require('../../../../@jridgewell_remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.cjs');
7
- const require_index = require('../../../../webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.cjs');
8
- let node_path = require("node:path");
9
- node_path = require_rolldown_runtime.__toESM(node_path);
10
- let node_buffer = require("node:buffer");
11
- let node_fs = require("node:fs");
12
- node_fs = require_rolldown_runtime.__toESM(node_fs);
13
- require("node:process");
14
- require("node:querystring");
15
-
16
- //#region ../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.mjs
17
- var import_lib = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index.default, 1);
18
- const TRANSFORM_LOADER$1 = (0, node_path.resolve)(__dirname, "rspack/loaders/transform.mjs");
19
- const LOAD_LOADER$1 = (0, node_path.resolve)(__dirname, "rspack/loaders/load.mjs");
20
- function getRspackPlugin(factory) {
21
- return (userOptions) => {
22
- return { apply(compiler) {
23
- const VIRTUAL_MODULE_PREFIX = (0, node_path.resolve)(compiler.options.context ?? process.cwd(), "node_modules/.virtual", compiler.rspack.experiments.VirtualModulesPlugin ? "" : process.pid.toString());
24
- const meta = {
25
- framework: "rspack",
26
- rspack: { compiler }
27
- };
28
- const rawPlugins = require_parse_CRORloGP.toArray(factory(userOptions, meta));
29
- for (const rawPlugin of rawPlugins) {
30
- const plugin = Object.assign(rawPlugin, {
31
- __unpluginMeta: meta,
32
- __virtualModulePrefix: VIRTUAL_MODULE_PREFIX
33
- });
34
- const externalModules = /* @__PURE__ */ new Set();
35
- if (plugin.resolveId) {
36
- const createPlugin = (plugin$1) => {
37
- if (compiler.rspack.experiments.VirtualModulesPlugin) return new compiler.rspack.experiments.VirtualModulesPlugin();
38
- return new require_utils_CuyC8gTr.FakeVirtualModulesPlugin(plugin$1);
39
- };
40
- const vfs = createPlugin(plugin);
41
- vfs.apply(compiler);
42
- const vfsModules = /* @__PURE__ */ new Map();
43
- plugin.__vfsModules = vfsModules;
44
- plugin.__vfs = vfs;
45
- compiler.hooks.compilation.tap(plugin.name, (compilation, { normalModuleFactory }) => {
46
- normalModuleFactory.hooks.resolve.tapPromise(plugin.name, async (resolveData) => {
47
- const id = require_webpack_like_BU9ULG6P.normalizeAbsolutePath(resolveData.request);
48
- const requestContext = resolveData.contextInfo;
49
- let importer = requestContext.issuer !== "" ? requestContext.issuer : void 0;
50
- const isEntry = requestContext.issuer === "";
51
- if (importer?.startsWith(plugin.__virtualModulePrefix)) importer = decodeURIComponent(importer.slice(plugin.__virtualModulePrefix.length));
52
- const context = require_context_CehLHpzV.createBuildContext(compiler, compilation);
53
- let error;
54
- const pluginContext = {
55
- error(msg) {
56
- if (error == null) error = require_context_CehLHpzV.normalizeMessage(msg);
57
- else console.error(`unplugin/rspack: multiple errors returned from resolveId hook: ${msg}`);
58
- },
59
- warn(msg) {
60
- console.warn(`unplugin/rspack: warning from resolveId hook: ${msg}`);
61
- }
62
- };
63
- const { handler, filter } = require_parse_CRORloGP.normalizeObjectHook("resolveId", plugin.resolveId);
64
- if (!filter(id)) return;
65
- const resolveIdResult = await handler.call({
66
- ...context,
67
- ...pluginContext
68
- }, id, importer, { isEntry });
69
- if (error != null) throw error;
70
- if (resolveIdResult == null) return;
71
- let resolved = typeof resolveIdResult === "string" ? resolveIdResult : resolveIdResult.id;
72
- if (typeof resolveIdResult === "string" ? false : resolveIdResult.external === true) externalModules.add(resolved);
73
- let isVirtual = true;
74
- try {
75
- (compiler.inputFileSystem?.statSync ?? node_fs.default.statSync)(resolved);
76
- isVirtual = false;
77
- } catch {
78
- isVirtual = !require_utils_CuyC8gTr.isVirtualModuleId(resolved, plugin);
79
- }
80
- if (isVirtual) {
81
- const encodedVirtualPath = require_utils_CuyC8gTr.encodeVirtualModuleId(resolved, plugin);
82
- if (!vfsModules.has(resolved)) {
83
- const fsPromise = Promise.resolve(vfs.writeModule(encodedVirtualPath, ""));
84
- vfsModules.set(resolved, fsPromise);
85
- await fsPromise;
86
- } else await vfsModules.get(resolved);
87
- resolved = encodedVirtualPath;
88
- }
89
- resolveData.request = resolved;
90
- });
91
- });
92
- }
93
- if (plugin.load) compiler.options.module.rules.unshift({
94
- enforce: plugin.enforce,
95
- include(id) {
96
- if (require_utils_CuyC8gTr.isVirtualModuleId(id, plugin)) id = require_utils_CuyC8gTr.decodeVirtualModuleId(id, plugin);
97
- if (plugin.loadInclude && !plugin.loadInclude(id)) return false;
98
- const { filter } = require_parse_CRORloGP.normalizeObjectHook("load", plugin.load);
99
- if (!filter(id)) return false;
100
- return !externalModules.has(id);
101
- },
102
- use: [{
103
- loader: LOAD_LOADER$1,
104
- options: { plugin }
105
- }],
106
- type: "javascript/auto"
107
- });
108
- if (plugin.transform) compiler.options.module.rules.unshift({
109
- enforce: plugin.enforce,
110
- use(data) {
111
- return require_webpack_like_BU9ULG6P.transformUse(data, plugin, TRANSFORM_LOADER$1);
112
- }
113
- });
114
- if (plugin.rspack) plugin.rspack(compiler);
115
- if (plugin.watchChange || plugin.buildStart) compiler.hooks.make.tapPromise(plugin.name, async (compilation) => {
116
- const context = require_context_CehLHpzV.createBuildContext(compiler, compilation);
117
- if (plugin.watchChange && (compiler.modifiedFiles || compiler.removedFiles)) {
118
- const promises = [];
119
- if (compiler.modifiedFiles) compiler.modifiedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "update" }))));
120
- if (compiler.removedFiles) compiler.removedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "delete" }))));
121
- await Promise.all(promises);
122
- }
123
- if (plugin.buildStart) return await plugin.buildStart.call(context);
124
- });
125
- if (plugin.buildEnd) compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => {
126
- await plugin.buildEnd.call(require_context_CehLHpzV.createBuildContext(compiler, compilation));
127
- });
128
- if (plugin.writeBundle) compiler.hooks.afterEmit.tapPromise(plugin.name, async () => {
129
- await plugin.writeBundle();
130
- });
131
- }
132
- } };
133
- };
134
- }
135
- const TRANSFORM_LOADER = (0, node_path.resolve)(__dirname, "webpack/loaders/transform.mjs");
136
- const LOAD_LOADER = (0, node_path.resolve)(__dirname, "webpack/loaders/load.mjs");
137
- function createRspackPlugin(factory) {
138
- return getRspackPlugin(factory);
139
- }
140
-
141
- //#endregion
142
- exports.createRspackPlugin = createRspackPlugin;
@@ -1,141 +0,0 @@
1
- import { __toESM } from "../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { normalizeObjectHook, toArray } from "./parse-CRORloGP.mjs";
3
- import { normalizeAbsolutePath, transformUse } from "./webpack-like-BU9ULG6P.mjs";
4
- import { createBuildContext, normalizeMessage } from "./context-CehLHpzV.mjs";
5
- import { FakeVirtualModulesPlugin, decodeVirtualModuleId, encodeVirtualModuleId, isVirtualModuleId } from "./utils-CuyC8gTr.mjs";
6
- import "../../../../@jridgewell_remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.mjs";
7
- import { require_lib } from "../../../../webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.mjs";
8
- import { isAbsolute, resolve } from "node:path";
9
- import { Buffer } from "node:buffer";
10
- import fs from "node:fs";
11
- import "node:process";
12
- import "node:querystring";
13
-
14
- //#region ../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.mjs
15
- var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
16
- const TRANSFORM_LOADER$1 = resolve(import.meta.dirname, "rspack/loaders/transform.mjs");
17
- const LOAD_LOADER$1 = resolve(import.meta.dirname, "rspack/loaders/load.mjs");
18
- function getRspackPlugin(factory) {
19
- return (userOptions) => {
20
- return { apply(compiler) {
21
- const VIRTUAL_MODULE_PREFIX = resolve(compiler.options.context ?? process.cwd(), "node_modules/.virtual", compiler.rspack.experiments.VirtualModulesPlugin ? "" : process.pid.toString());
22
- const meta = {
23
- framework: "rspack",
24
- rspack: { compiler }
25
- };
26
- const rawPlugins = toArray(factory(userOptions, meta));
27
- for (const rawPlugin of rawPlugins) {
28
- const plugin = Object.assign(rawPlugin, {
29
- __unpluginMeta: meta,
30
- __virtualModulePrefix: VIRTUAL_MODULE_PREFIX
31
- });
32
- const externalModules = /* @__PURE__ */ new Set();
33
- if (plugin.resolveId) {
34
- const createPlugin = (plugin$1) => {
35
- if (compiler.rspack.experiments.VirtualModulesPlugin) return new compiler.rspack.experiments.VirtualModulesPlugin();
36
- return new FakeVirtualModulesPlugin(plugin$1);
37
- };
38
- const vfs = createPlugin(plugin);
39
- vfs.apply(compiler);
40
- const vfsModules = /* @__PURE__ */ new Map();
41
- plugin.__vfsModules = vfsModules;
42
- plugin.__vfs = vfs;
43
- compiler.hooks.compilation.tap(plugin.name, (compilation, { normalModuleFactory }) => {
44
- normalModuleFactory.hooks.resolve.tapPromise(plugin.name, async (resolveData) => {
45
- const id = normalizeAbsolutePath(resolveData.request);
46
- const requestContext = resolveData.contextInfo;
47
- let importer = requestContext.issuer !== "" ? requestContext.issuer : void 0;
48
- const isEntry = requestContext.issuer === "";
49
- if (importer?.startsWith(plugin.__virtualModulePrefix)) importer = decodeURIComponent(importer.slice(plugin.__virtualModulePrefix.length));
50
- const context = createBuildContext(compiler, compilation);
51
- let error;
52
- const pluginContext = {
53
- error(msg) {
54
- if (error == null) error = normalizeMessage(msg);
55
- else console.error(`unplugin/rspack: multiple errors returned from resolveId hook: ${msg}`);
56
- },
57
- warn(msg) {
58
- console.warn(`unplugin/rspack: warning from resolveId hook: ${msg}`);
59
- }
60
- };
61
- const { handler, filter } = normalizeObjectHook("resolveId", plugin.resolveId);
62
- if (!filter(id)) return;
63
- const resolveIdResult = await handler.call({
64
- ...context,
65
- ...pluginContext
66
- }, id, importer, { isEntry });
67
- if (error != null) throw error;
68
- if (resolveIdResult == null) return;
69
- let resolved = typeof resolveIdResult === "string" ? resolveIdResult : resolveIdResult.id;
70
- if (typeof resolveIdResult === "string" ? false : resolveIdResult.external === true) externalModules.add(resolved);
71
- let isVirtual = true;
72
- try {
73
- (compiler.inputFileSystem?.statSync ?? fs.statSync)(resolved);
74
- isVirtual = false;
75
- } catch {
76
- isVirtual = !isVirtualModuleId(resolved, plugin);
77
- }
78
- if (isVirtual) {
79
- const encodedVirtualPath = encodeVirtualModuleId(resolved, plugin);
80
- if (!vfsModules.has(resolved)) {
81
- const fsPromise = Promise.resolve(vfs.writeModule(encodedVirtualPath, ""));
82
- vfsModules.set(resolved, fsPromise);
83
- await fsPromise;
84
- } else await vfsModules.get(resolved);
85
- resolved = encodedVirtualPath;
86
- }
87
- resolveData.request = resolved;
88
- });
89
- });
90
- }
91
- if (plugin.load) compiler.options.module.rules.unshift({
92
- enforce: plugin.enforce,
93
- include(id) {
94
- if (isVirtualModuleId(id, plugin)) id = decodeVirtualModuleId(id, plugin);
95
- if (plugin.loadInclude && !plugin.loadInclude(id)) return false;
96
- const { filter } = normalizeObjectHook("load", plugin.load);
97
- if (!filter(id)) return false;
98
- return !externalModules.has(id);
99
- },
100
- use: [{
101
- loader: LOAD_LOADER$1,
102
- options: { plugin }
103
- }],
104
- type: "javascript/auto"
105
- });
106
- if (plugin.transform) compiler.options.module.rules.unshift({
107
- enforce: plugin.enforce,
108
- use(data) {
109
- return transformUse(data, plugin, TRANSFORM_LOADER$1);
110
- }
111
- });
112
- if (plugin.rspack) plugin.rspack(compiler);
113
- if (plugin.watchChange || plugin.buildStart) compiler.hooks.make.tapPromise(plugin.name, async (compilation) => {
114
- const context = createBuildContext(compiler, compilation);
115
- if (plugin.watchChange && (compiler.modifiedFiles || compiler.removedFiles)) {
116
- const promises = [];
117
- if (compiler.modifiedFiles) compiler.modifiedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "update" }))));
118
- if (compiler.removedFiles) compiler.removedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "delete" }))));
119
- await Promise.all(promises);
120
- }
121
- if (plugin.buildStart) return await plugin.buildStart.call(context);
122
- });
123
- if (plugin.buildEnd) compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => {
124
- await plugin.buildEnd.call(createBuildContext(compiler, compilation));
125
- });
126
- if (plugin.writeBundle) compiler.hooks.afterEmit.tapPromise(plugin.name, async () => {
127
- await plugin.writeBundle();
128
- });
129
- }
130
- } };
131
- };
132
- }
133
- const TRANSFORM_LOADER = resolve(import.meta.dirname, "webpack/loaders/transform.mjs");
134
- const LOAD_LOADER = resolve(import.meta.dirname, "webpack/loaders/load.mjs");
135
- function createRspackPlugin(factory) {
136
- return getRspackPlugin(factory);
137
- }
138
-
139
- //#endregion
140
- export { createRspackPlugin };
141
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":["createBuildContext$1","normalizeMessage$1"],"sources":["../../../../../../../../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.mjs"],"sourcesContent":["import { i as toArray, n as setParseImpl, r as normalizeObjectHook, t as parse } from \"./parse-CRORloGP.mjs\";\nimport { n as transformUse, t as normalizeAbsolutePath } from \"./webpack-like-BU9ULG6P.mjs\";\nimport { r as normalizeMessage$1, t as createBuildContext$1 } from \"./context-CehLHpzV.mjs\";\nimport { i as isVirtualModuleId, n as decodeVirtualModuleId, r as encodeVirtualModuleId, t as FakeVirtualModulesPlugin } from \"./utils-CuyC8gTr.mjs\";\nimport { i as normalizeMessage, n as createBuildContext, t as contextOptionsFromCompilation } from \"./context-CY6F6zw6.mjs\";\nimport path, { extname, isAbsolute, resolve } from \"node:path\";\nimport fs from \"node:fs\";\nimport { Buffer } from \"node:buffer\";\nimport remapping from \"@jridgewell/remapping\";\nimport * as querystring from \"node:querystring\";\nimport process$1 from \"node:process\";\nimport VirtualModulesPlugin from \"webpack-virtual-modules\";\n\n//#region src/bun/utils.ts\nconst ExtToLoader$1 = {\n\t\".js\": \"js\",\n\t\".mjs\": \"js\",\n\t\".cjs\": \"js\",\n\t\".jsx\": \"jsx\",\n\t\".ts\": \"ts\",\n\t\".cts\": \"ts\",\n\t\".mts\": \"ts\",\n\t\".tsx\": \"tsx\",\n\t\".css\": \"css\",\n\t\".less\": \"css\",\n\t\".stylus\": \"css\",\n\t\".scss\": \"css\",\n\t\".sass\": \"css\",\n\t\".json\": \"json\",\n\t\".txt\": \"text\"\n};\nfunction guessLoader$1(id) {\n\treturn ExtToLoader$1[path.extname(id).toLowerCase()] || \"js\";\n}\nfunction createBuildContext$3(build) {\n\tconst watchFiles = [];\n\treturn {\n\t\taddWatchFile(file) {\n\t\t\twatchFiles.push(file);\n\t\t},\n\t\tgetWatchFiles() {\n\t\t\treturn watchFiles;\n\t\t},\n\t\temitFile(emittedFile) {\n\t\t\tconst outFileName = emittedFile.fileName || emittedFile.name;\n\t\t\tconst outdir = build?.config?.outdir;\n\t\t\tif (outdir && emittedFile.source && outFileName) {\n\t\t\t\tconst outPath = path.resolve(outdir, outFileName);\n\t\t\t\tconst outDir = path.dirname(outPath);\n\t\t\t\tif (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });\n\t\t\t\tfs.writeFileSync(outPath, emittedFile.source);\n\t\t\t}\n\t\t},\n\t\tparse,\n\t\tgetNativeBuildContext() {\n\t\t\treturn {\n\t\t\t\tframework: \"bun\",\n\t\t\t\tbuild\n\t\t\t};\n\t\t}\n\t};\n}\nfunction createPluginContext$1(buildContext) {\n\tconst errors = [];\n\tconst warnings = [];\n\treturn {\n\t\terrors,\n\t\twarnings,\n\t\tmixedContext: {\n\t\t\t...buildContext,\n\t\t\terror(error) {\n\t\t\t\terrors.push(error);\n\t\t\t},\n\t\t\twarn(warning) {\n\t\t\t\twarnings.push(warning);\n\t\t\t}\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/bun/index.ts\nfunction getBunPlugin(factory) {\n\treturn (userOptions) => {\n\t\tif (typeof Bun === \"undefined\") throw new ReferenceError(\"Bun is not supported in this environment\");\n\t\tif (!Bun.semver.satisfies(Bun.version, \">=1.2.22\")) throw new Error(\"Bun 1.2.22 or higher is required, please upgrade Bun\");\n\t\tconst meta = { framework: \"bun\" };\n\t\tconst plugins = toArray(factory(userOptions, meta));\n\t\treturn {\n\t\t\tname: (plugins.length === 1 ? plugins[0].name : meta.bunHostName) ?? `unplugin-host:${plugins.map((p) => p.name).join(\":\")}`,\n\t\t\tasync setup(build) {\n\t\t\t\tconst context = createBuildContext$3(build);\n\t\t\t\tif (plugins.some((plugin) => plugin.buildStart)) build.onStart(async () => {\n\t\t\t\t\tfor (const plugin of plugins) if (plugin.buildStart) await plugin.buildStart.call(context);\n\t\t\t\t});\n\t\t\t\tconst resolveIdHooks = plugins.filter((plugin) => plugin.resolveId).map((plugin) => ({\n\t\t\t\t\tplugin,\n\t\t\t\t\t...normalizeObjectHook(\"resolveId\", plugin.resolveId)\n\t\t\t\t}));\n\t\t\t\tconst loadHooks = plugins.filter((plugin) => plugin.load).map((plugin) => ({\n\t\t\t\t\tplugin,\n\t\t\t\t\t...normalizeObjectHook(\"load\", plugin.load)\n\t\t\t\t}));\n\t\t\t\tconst transformHooks = plugins.filter((plugin) => plugin.transform || plugin.transformInclude).map((plugin) => ({\n\t\t\t\t\tplugin,\n\t\t\t\t\t...normalizeObjectHook(\"transform\", plugin.transform)\n\t\t\t\t}));\n\t\t\t\tconst virtualModulePlugins = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const plugin of plugins) if (plugin.resolveId && plugin.load) virtualModulePlugins.add(plugin.name);\n\t\t\t\tif (resolveIdHooks.length) build.onResolve({ filter: /.*/ }, async (args) => {\n\t\t\t\t\tif (build.config?.external?.includes(args.path)) return;\n\t\t\t\t\tfor (const { plugin, handler, filter } of resolveIdHooks) {\n\t\t\t\t\t\tif (!filter(args.path)) continue;\n\t\t\t\t\t\tconst { mixedContext, errors, warnings } = createPluginContext$1(context);\n\t\t\t\t\t\tconst isEntry = args.kind === \"entry-point-run\" || args.kind === \"entry-point-build\";\n\t\t\t\t\t\tconst result = await handler.call(mixedContext, args.path, isEntry ? void 0 : args.importer, { isEntry });\n\t\t\t\t\t\tfor (const warning of warnings) console.warn(\"[unplugin]\", typeof warning === \"string\" ? warning : warning.message);\n\t\t\t\t\t\tif (errors.length > 0) {\n\t\t\t\t\t\t\tconst errorMessage = errors.map((e) => typeof e === \"string\" ? e : e.message).join(\"\\n\");\n\t\t\t\t\t\t\tthrow new Error(`[unplugin] ${plugin.name}: ${errorMessage}`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (typeof result === \"string\") {\n\t\t\t\t\t\t\tif (!isAbsolute(result)) return {\n\t\t\t\t\t\t\t\tpath: result,\n\t\t\t\t\t\t\t\tnamespace: plugin.name\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn { path: result };\n\t\t\t\t\t\t} else if (typeof result === \"object\" && result !== null) {\n\t\t\t\t\t\t\tif (!isAbsolute(result.id)) return {\n\t\t\t\t\t\t\t\tpath: result.id,\n\t\t\t\t\t\t\t\texternal: result.external,\n\t\t\t\t\t\t\t\tnamespace: plugin.name\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tpath: result.id,\n\t\t\t\t\t\t\t\texternal: result.external\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tasync function processLoadTransform(id, namespace, loader) {\n\t\t\t\t\tlet code;\n\t\t\t\t\tlet hasResult = false;\n\t\t\t\t\tconst namespaceLoadHooks = namespace === \"file\" ? loadHooks : loadHooks.filter((h) => h.plugin.name === namespace);\n\t\t\t\t\tfor (const { plugin, handler, filter } of namespaceLoadHooks) {\n\t\t\t\t\t\tif (plugin.loadInclude && !plugin.loadInclude(id)) continue;\n\t\t\t\t\t\tif (!filter(id)) continue;\n\t\t\t\t\t\tconst { mixedContext, errors, warnings } = createPluginContext$1(context);\n\t\t\t\t\t\tconst result = await handler.call(mixedContext, id);\n\t\t\t\t\t\tfor (const warning of warnings) console.warn(\"[unplugin]\", typeof warning === \"string\" ? warning : warning.message);\n\t\t\t\t\t\tif (errors.length > 0) {\n\t\t\t\t\t\t\tconst errorMessage = errors.map((e) => typeof e === \"string\" ? e : e.message).join(\"\\n\");\n\t\t\t\t\t\t\tthrow new Error(`[unplugin] ${plugin.name}: ${errorMessage}`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (typeof result === \"string\") {\n\t\t\t\t\t\t\tcode = result;\n\t\t\t\t\t\t\thasResult = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (typeof result === \"object\" && result !== null) {\n\t\t\t\t\t\t\tcode = result.code;\n\t\t\t\t\t\t\thasResult = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!hasResult && namespace === \"file\" && transformHooks.length > 0) code = await Bun.file(id).text();\n\t\t\t\t\tif (code !== void 0) {\n\t\t\t\t\t\tconst namespaceTransformHooks = namespace === \"file\" ? transformHooks : transformHooks.filter((h) => h.plugin.name === namespace);\n\t\t\t\t\t\tfor (const { plugin, handler, filter } of namespaceTransformHooks) {\n\t\t\t\t\t\t\tif (plugin.transformInclude && !plugin.transformInclude(id)) continue;\n\t\t\t\t\t\t\tif (!filter(id, code)) continue;\n\t\t\t\t\t\t\tconst { mixedContext, errors, warnings } = createPluginContext$1(context);\n\t\t\t\t\t\t\tconst result = await handler.call(mixedContext, code, id);\n\t\t\t\t\t\t\tfor (const warning of warnings) console.warn(\"[unplugin]\", typeof warning === \"string\" ? warning : warning.message);\n\t\t\t\t\t\t\tif (errors.length > 0) {\n\t\t\t\t\t\t\t\tconst errorMessage = errors.map((e) => typeof e === \"string\" ? e : e.message).join(\"\\n\");\n\t\t\t\t\t\t\t\tthrow new Error(`[unplugin] ${plugin.name}: ${errorMessage}`);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (typeof result === \"string\") {\n\t\t\t\t\t\t\t\tcode = result;\n\t\t\t\t\t\t\t\thasResult = true;\n\t\t\t\t\t\t\t} else if (typeof result === \"object\" && result !== null) {\n\t\t\t\t\t\t\t\tcode = result.code;\n\t\t\t\t\t\t\t\thasResult = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (hasResult && code !== void 0) return {\n\t\t\t\t\t\tcontents: code,\n\t\t\t\t\t\tloader: loader ?? guessLoader$1(id)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (loadHooks.length || transformHooks.length) build.onLoad({\n\t\t\t\t\tfilter: /.*/,\n\t\t\t\t\tnamespace: \"file\"\n\t\t\t\t}, async (args) => {\n\t\t\t\t\treturn processLoadTransform(args.path, \"file\", args.loader);\n\t\t\t\t});\n\t\t\t\tfor (const pluginName of virtualModulePlugins) build.onLoad({\n\t\t\t\t\tfilter: /.*/,\n\t\t\t\t\tnamespace: pluginName\n\t\t\t\t}, async (args) => {\n\t\t\t\t\treturn processLoadTransform(args.path, pluginName, args.loader);\n\t\t\t\t});\n\t\t\t\tif (plugins.some((plugin) => plugin.buildEnd || plugin.writeBundle)) build.onEnd(async () => {\n\t\t\t\t\tfor (const plugin of plugins) {\n\t\t\t\t\t\tif (plugin.buildEnd) await plugin.buildEnd.call(context);\n\t\t\t\t\t\tif (plugin.writeBundle) await plugin.writeBundle();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t};\n}\n\n//#endregion\n//#region src/esbuild/utils.ts\nconst ExtToLoader = {\n\t\".js\": \"js\",\n\t\".mjs\": \"js\",\n\t\".cjs\": \"js\",\n\t\".jsx\": \"jsx\",\n\t\".ts\": \"ts\",\n\t\".cts\": \"ts\",\n\t\".mts\": \"ts\",\n\t\".tsx\": \"tsx\",\n\t\".css\": \"css\",\n\t\".less\": \"css\",\n\t\".stylus\": \"css\",\n\t\".scss\": \"css\",\n\t\".sass\": \"css\",\n\t\".json\": \"json\",\n\t\".txt\": \"text\"\n};\nfunction guessLoader(code, id) {\n\treturn ExtToLoader[path.extname(id).toLowerCase()] || \"js\";\n}\nfunction unwrapLoader(loader, code, id) {\n\tif (typeof loader === \"function\") return loader(code, id);\n\treturn loader;\n}\nfunction fixSourceMap(map) {\n\tif (!Object.prototype.hasOwnProperty.call(map, \"toString\")) Object.defineProperty(map, \"toString\", {\n\t\tenumerable: false,\n\t\tvalue: function toString() {\n\t\t\treturn JSON.stringify(this);\n\t\t}\n\t});\n\tif (!Object.prototype.hasOwnProperty.call(map, \"toUrl\")) Object.defineProperty(map, \"toUrl\", {\n\t\tenumerable: false,\n\t\tvalue: function toUrl() {\n\t\t\treturn `data:application/json;charset=utf-8;base64,${Buffer.from(this.toString()).toString(\"base64\")}`;\n\t\t}\n\t});\n\treturn map;\n}\nconst nullSourceMap = {\n\tnames: [],\n\tsources: [],\n\tmappings: \"\",\n\tversion: 3\n};\nfunction combineSourcemaps(filename, sourcemapList) {\n\tsourcemapList = sourcemapList.filter((m) => m.sources);\n\tif (sourcemapList.length === 0 || sourcemapList.every((m) => m.sources.length === 0)) return { ...nullSourceMap };\n\tlet map;\n\tlet mapIndex = 1;\n\tif (sourcemapList.slice(0, -1).find((m) => m.sources.length !== 1) === void 0) map = remapping(sourcemapList, () => null, true);\n\telse map = remapping(sourcemapList[0], (sourcefile) => {\n\t\tif (sourcefile === filename && sourcemapList[mapIndex]) return sourcemapList[mapIndex++];\n\t\telse return { ...nullSourceMap };\n\t}, true);\n\tif (!map.file) delete map.file;\n\treturn map;\n}\nfunction createBuildContext$2(build) {\n\tconst watchFiles = [];\n\tconst { initialOptions } = build;\n\treturn {\n\t\tparse,\n\t\taddWatchFile() {\n\t\t\tthrow new Error(\"unplugin/esbuild: addWatchFile outside supported hooks (resolveId, load, transform)\");\n\t\t},\n\t\temitFile(emittedFile) {\n\t\t\tconst outFileName = emittedFile.fileName || emittedFile.name;\n\t\t\tif (initialOptions.outdir && emittedFile.source && outFileName) {\n\t\t\t\tconst outPath = path.resolve(initialOptions.outdir, outFileName);\n\t\t\t\tconst outDir = path.dirname(outPath);\n\t\t\t\tif (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });\n\t\t\t\tfs.writeFileSync(outPath, emittedFile.source);\n\t\t\t}\n\t\t},\n\t\tgetWatchFiles() {\n\t\t\treturn watchFiles;\n\t\t},\n\t\tgetNativeBuildContext() {\n\t\t\treturn {\n\t\t\t\tframework: \"esbuild\",\n\t\t\t\tbuild\n\t\t\t};\n\t\t}\n\t};\n}\nfunction createPluginContext(context) {\n\tconst errors = [];\n\tconst warnings = [];\n\tconst pluginContext = {\n\t\terror(message) {\n\t\t\terrors.push(normalizeMessage$2(message));\n\t\t},\n\t\twarn(message) {\n\t\t\twarnings.push(normalizeMessage$2(message));\n\t\t}\n\t};\n\treturn {\n\t\terrors,\n\t\twarnings,\n\t\tmixedContext: {\n\t\t\t...context,\n\t\t\t...pluginContext,\n\t\t\taddWatchFile(id) {\n\t\t\t\tcontext.getWatchFiles().push(id);\n\t\t\t}\n\t\t}\n\t};\n}\nfunction normalizeMessage$2(message) {\n\tif (typeof message === \"string\") message = { message };\n\treturn {\n\t\tid: message.id,\n\t\tpluginName: message.plugin,\n\t\ttext: message.message,\n\t\tlocation: message.loc ? {\n\t\t\tfile: message.loc.file,\n\t\t\tline: message.loc.line,\n\t\t\tcolumn: message.loc.column\n\t\t} : null,\n\t\tdetail: message.meta,\n\t\tnotes: []\n\t};\n}\nfunction processCodeWithSourceMap(map, code) {\n\tif (map) {\n\t\tif (!map.sourcesContent || map.sourcesContent.length === 0) map.sourcesContent = [code];\n\t\tmap = fixSourceMap(map);\n\t\tcode += `\\n//# sourceMappingURL=${map.toUrl()}`;\n\t}\n\treturn code;\n}\n\n//#endregion\n//#region src/esbuild/index.ts\nfunction getEsbuildPlugin(factory) {\n\treturn (userOptions) => {\n\t\tconst meta = { framework: \"esbuild\" };\n\t\tconst plugins = toArray(factory(userOptions, meta));\n\t\tconst setupPlugins = async (build) => {\n\t\t\tconst setup = buildSetup();\n\t\t\tconst loaders = [];\n\t\t\tfor (const plugin of plugins) {\n\t\t\t\tconst loader = {};\n\t\t\t\tawait setup(plugin)({\n\t\t\t\t\t...build,\n\t\t\t\t\tonLoad(_options, callback) {\n\t\t\t\t\t\tloader.options = _options;\n\t\t\t\t\t\tloader.onLoadCb = callback;\n\t\t\t\t\t},\n\t\t\t\t\tonTransform(_options, callback) {\n\t\t\t\t\t\tloader.options ||= _options;\n\t\t\t\t\t\tloader.onTransformCb = callback;\n\t\t\t\t\t}\n\t\t\t\t}, build);\n\t\t\t\tif (loader.onLoadCb || loader.onTransformCb) loaders.push(loader);\n\t\t\t}\n\t\t\tif (loaders.length) build.onLoad(loaders.length === 1 ? loaders[0].options : { filter: /.*/ }, async (args) => {\n\t\t\t\tfunction checkFilter(options) {\n\t\t\t\t\treturn loaders.length === 1 || !options?.filter || options.filter.test(args.path);\n\t\t\t\t}\n\t\t\t\tlet result;\n\t\t\t\tfor (const { options, onLoadCb } of loaders) {\n\t\t\t\t\tif (!checkFilter(options)) continue;\n\t\t\t\t\tif (onLoadCb) result = await onLoadCb(args);\n\t\t\t\t\tif (result?.contents) break;\n\t\t\t\t}\n\t\t\t\tlet fsContentsCache;\n\t\t\t\tfor (const { options, onTransformCb } of loaders) {\n\t\t\t\t\tif (!checkFilter(options)) continue;\n\t\t\t\t\tif (onTransformCb) {\n\t\t\t\t\t\tconst _result = await onTransformCb({\n\t\t\t\t\t\t\t...result,\n\t\t\t\t\t\t\t...args,\n\t\t\t\t\t\t\tasync getContents() {\n\t\t\t\t\t\t\t\tif (result?.contents) return result.contents;\n\t\t\t\t\t\t\t\tif (fsContentsCache) return fsContentsCache;\n\t\t\t\t\t\t\t\treturn fsContentsCache = await fs.promises.readFile(args.path, \"utf8\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (_result?.contents) result = _result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (result?.contents) return result;\n\t\t\t});\n\t\t};\n\t\treturn {\n\t\t\tname: (plugins.length === 1 ? plugins[0].name : meta.esbuildHostName) ?? `unplugin-host:${plugins.map((p) => p.name).join(\":\")}`,\n\t\t\tsetup: setupPlugins\n\t\t};\n\t};\n}\nfunction buildSetup() {\n\treturn (plugin) => {\n\t\treturn (build, rawBuild) => {\n\t\t\tconst context = createBuildContext$2(rawBuild);\n\t\t\tconst { onStart, onEnd, onResolve, onLoad, onTransform, initialOptions } = build;\n\t\t\tconst onResolveFilter = plugin.esbuild?.onResolveFilter ?? /.*/;\n\t\t\tconst onLoadFilter = plugin.esbuild?.onLoadFilter ?? /.*/;\n\t\t\tconst loader = plugin.esbuild?.loader ?? guessLoader;\n\t\t\tplugin.esbuild?.config?.call(context, initialOptions);\n\t\t\tif (plugin.buildStart) onStart(() => plugin.buildStart.call(context));\n\t\t\tif (plugin.buildEnd || plugin.writeBundle) onEnd(async () => {\n\t\t\t\tif (plugin.buildEnd) await plugin.buildEnd.call(context);\n\t\t\t\tif (plugin.writeBundle) await plugin.writeBundle();\n\t\t\t});\n\t\t\tif (plugin.resolveId) onResolve({ filter: onResolveFilter }, async (args) => {\n\t\t\t\tconst id = args.path;\n\t\t\t\tif (initialOptions.external?.includes(id)) return;\n\t\t\t\tconst { handler, filter } = normalizeObjectHook(\"resolveId\", plugin.resolveId);\n\t\t\t\tif (!filter(id)) return;\n\t\t\t\tconst { errors, warnings, mixedContext } = createPluginContext(context);\n\t\t\t\tconst isEntry = args.kind === \"entry-point\";\n\t\t\t\tconst result = await handler.call(mixedContext, id, isEntry ? void 0 : args.importer, { isEntry });\n\t\t\t\tif (typeof result === \"string\") return {\n\t\t\t\t\tpath: result,\n\t\t\t\t\tnamespace: plugin.name,\n\t\t\t\t\terrors,\n\t\t\t\t\twarnings,\n\t\t\t\t\twatchFiles: mixedContext.getWatchFiles()\n\t\t\t\t};\n\t\t\t\telse if (typeof result === \"object\" && result !== null) return {\n\t\t\t\t\tpath: result.id,\n\t\t\t\t\texternal: result.external,\n\t\t\t\t\tnamespace: plugin.name,\n\t\t\t\t\terrors,\n\t\t\t\t\twarnings,\n\t\t\t\t\twatchFiles: mixedContext.getWatchFiles()\n\t\t\t\t};\n\t\t\t});\n\t\t\tif (plugin.load) onLoad({ filter: onLoadFilter }, async (args) => {\n\t\t\t\tconst { handler, filter } = normalizeObjectHook(\"load\", plugin.load);\n\t\t\t\tconst id = args.path + (args.suffix || \"\");\n\t\t\t\tif (plugin.loadInclude && !plugin.loadInclude(id)) return;\n\t\t\t\tif (!filter(id)) return;\n\t\t\t\tconst { errors, warnings, mixedContext } = createPluginContext(context);\n\t\t\t\tlet code;\n\t\t\t\tlet map;\n\t\t\t\tconst result = await handler.call(mixedContext, id);\n\t\t\t\tif (typeof result === \"string\") code = result;\n\t\t\t\telse if (typeof result === \"object\" && result !== null) {\n\t\t\t\t\tcode = result.code;\n\t\t\t\t\tmap = result.map;\n\t\t\t\t}\n\t\t\t\tif (code === void 0) return null;\n\t\t\t\tif (map) code = processCodeWithSourceMap(map, code);\n\t\t\t\tconst resolveDir = path.dirname(args.path);\n\t\t\t\treturn {\n\t\t\t\t\tcontents: code,\n\t\t\t\t\terrors,\n\t\t\t\t\twarnings,\n\t\t\t\t\twatchFiles: mixedContext.getWatchFiles(),\n\t\t\t\t\tloader: unwrapLoader(loader, code, args.path),\n\t\t\t\t\tresolveDir\n\t\t\t\t};\n\t\t\t});\n\t\t\tif (plugin.transform) onTransform({ filter: onLoadFilter }, async (args) => {\n\t\t\t\tconst { handler, filter } = normalizeObjectHook(\"transform\", plugin.transform);\n\t\t\t\tconst id = args.path + (args.suffix || \"\");\n\t\t\t\tif (plugin.transformInclude && !plugin.transformInclude(id)) return;\n\t\t\t\tlet code = await args.getContents();\n\t\t\t\tif (!filter(id, code)) return;\n\t\t\t\tconst { mixedContext, errors, warnings } = createPluginContext(context);\n\t\t\t\tconst resolveDir = path.dirname(args.path);\n\t\t\t\tlet map;\n\t\t\t\tconst result = await handler.call(mixedContext, code, id);\n\t\t\t\tif (typeof result === \"string\") code = result;\n\t\t\t\telse if (typeof result === \"object\" && result !== null) {\n\t\t\t\t\tcode = result.code;\n\t\t\t\t\tif (map && result.map) map = combineSourcemaps(args.path, [result.map === \"string\" ? JSON.parse(result.map) : result.map, map]);\n\t\t\t\t\telse if (typeof result.map === \"string\") map = JSON.parse(result.map);\n\t\t\t\t\telse map = result.map;\n\t\t\t\t}\n\t\t\t\tif (code) {\n\t\t\t\t\tif (map) code = processCodeWithSourceMap(map, code);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontents: code,\n\t\t\t\t\t\terrors,\n\t\t\t\t\t\twarnings,\n\t\t\t\t\t\twatchFiles: mixedContext.getWatchFiles(),\n\t\t\t\t\t\tloader: unwrapLoader(loader, code, args.path),\n\t\t\t\t\t\tresolveDir\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (plugin.esbuild?.setup) return plugin.esbuild.setup(rawBuild);\n\t\t};\n\t};\n}\n\n//#endregion\n//#region src/farm/context.ts\nfunction createFarmContext(context, currentResolveId) {\n\treturn {\n\t\tparse,\n\t\taddWatchFile(id) {\n\t\t\tcontext.addWatchFile(id, currentResolveId || id);\n\t\t},\n\t\temitFile(emittedFile) {\n\t\t\tconst outFileName = emittedFile.fileName || emittedFile.name;\n\t\t\tif (emittedFile.source && outFileName) context.emitFile({\n\t\t\t\tresolvedPath: outFileName,\n\t\t\t\tname: outFileName,\n\t\t\t\tcontent: [...Buffer.from(emittedFile.source)],\n\t\t\t\tresourceType: extname(outFileName)\n\t\t\t});\n\t\t},\n\t\tgetWatchFiles() {\n\t\t\treturn context.getWatchFiles();\n\t\t},\n\t\tgetNativeBuildContext() {\n\t\t\treturn {\n\t\t\t\tframework: \"farm\",\n\t\t\t\tcontext\n\t\t\t};\n\t\t}\n\t};\n}\nfunction unpluginContext(context) {\n\treturn {\n\t\terror: (error) => context.error(typeof error === \"string\" ? new Error(error) : error),\n\t\twarn: (error) => context.warn(typeof error === \"string\" ? new Error(error) : error)\n\t};\n}\n\n//#endregion\n//#region src/farm/utils.ts\nfunction convertEnforceToPriority(value) {\n\tconst defaultPriority = 100;\n\tconst enforceToPriority = {\n\t\tpre: 102,\n\t\tpost: 98\n\t};\n\treturn enforceToPriority[value] !== void 0 ? enforceToPriority[value] : defaultPriority;\n}\nfunction convertWatchEventChange(value) {\n\treturn {\n\t\tAdded: \"create\",\n\t\tUpdated: \"update\",\n\t\tRemoved: \"delete\"\n\t}[value];\n}\nfunction isString(variable) {\n\treturn typeof variable === \"string\";\n}\nfunction isObject(variable) {\n\treturn typeof variable === \"object\" && variable !== null;\n}\nfunction customParseQueryString(url) {\n\tif (!url) return [];\n\tconst queryString = url.split(\"?\")[1];\n\tconst parsedParams = querystring.parse(queryString);\n\tconst paramsArray = [];\n\tfor (const key in parsedParams) paramsArray.push([key, parsedParams[key]]);\n\treturn paramsArray;\n}\nfunction encodeStr(str) {\n\tconst len = str.length;\n\tif (len === 0) return str;\n\tconst firstNullIndex = str.indexOf(\"\\0\");\n\tif (firstNullIndex === -1) return str;\n\tconst result = Array.from({ length: len + countNulls(str, firstNullIndex) });\n\tlet pos = 0;\n\tfor (let i = 0; i < firstNullIndex; i++) result[pos++] = str[i];\n\tfor (let i = firstNullIndex; i < len; i++) {\n\t\tconst char = str[i];\n\t\tif (char === \"\\0\") {\n\t\t\tresult[pos++] = \"\\\\\";\n\t\t\tresult[pos++] = \"0\";\n\t\t} else result[pos++] = char;\n\t}\n\treturn path.posix.normalize(result.join(\"\"));\n}\nfunction decodeStr(str) {\n\tconst len = str.length;\n\tif (len === 0) return str;\n\tconst firstIndex = str.indexOf(\"\\\\0\");\n\tif (firstIndex === -1) return str;\n\tconst result = Array.from({ length: len - countBackslashZeros(str, firstIndex) });\n\tlet pos = 0;\n\tfor (let i$1 = 0; i$1 < firstIndex; i$1++) result[pos++] = str[i$1];\n\tlet i = firstIndex;\n\twhile (i < len) if (str[i] === \"\\\\\" && str[i + 1] === \"0\") {\n\t\tresult[pos++] = \"\\0\";\n\t\ti += 2;\n\t} else result[pos++] = str[i++];\n\treturn path.posix.normalize(result.join(\"\"));\n}\nfunction getContentValue(content) {\n\tif (content === null || content === void 0) throw new Error(\"Content cannot be null or undefined\");\n\treturn encodeStr(typeof content === \"string\" ? content : content.code || \"\");\n}\nfunction countNulls(str, startIndex) {\n\tlet count = 0;\n\tconst len = str.length;\n\tfor (let i = startIndex; i < len; i++) if (str[i] === \"\\0\") count++;\n\treturn count;\n}\nfunction countBackslashZeros(str, startIndex) {\n\tlet count = 0;\n\tconst len = str.length;\n\tfor (let i = startIndex; i < len - 1; i++) if (str[i] === \"\\\\\" && str[i + 1] === \"0\") {\n\t\tcount++;\n\t\ti++;\n\t}\n\treturn count;\n}\nfunction removeQuery(pathe) {\n\tconst queryIndex = pathe.indexOf(\"?\");\n\tif (queryIndex !== -1) return path.posix.normalize(pathe.slice(0, queryIndex));\n\treturn path.posix.normalize(pathe);\n}\nfunction isStartsWithSlash(str) {\n\treturn str?.startsWith(\"/\");\n}\nfunction appendQuery(id, query) {\n\tif (!query.length) return id;\n\treturn `${id}?${stringifyQuery(query)}`;\n}\nfunction stringifyQuery(query) {\n\tif (!query.length) return \"\";\n\tlet queryStr = \"\";\n\tfor (const [key, value] of query) queryStr += `${key}${value ? `=${value}` : \"\"}&`;\n\treturn `${queryStr.slice(0, -1)}`;\n}\nconst CSS_LANGS_RES = [\n\t[/\\.(less)(?:$|\\?)/, \"less\"],\n\t[/\\.(scss|sass)(?:$|\\?)/, \"sass\"],\n\t[/\\.(styl|stylus)(?:$|\\?)/, \"stylus\"],\n\t[/\\.(css)(?:$|\\?)/, \"css\"]\n];\nconst JS_LANGS_RES = [\n\t[/\\.(js|mjs|cjs)(?:$|\\?)/, \"js\"],\n\t[/\\.(jsx)(?:$|\\?)/, \"jsx\"],\n\t[/\\.(ts|cts|mts)(?:$|\\?)/, \"ts\"],\n\t[/\\.(tsx)(?:$|\\?)/, \"tsx\"]\n];\nfunction getCssModuleType(id) {\n\tfor (const [reg, lang] of CSS_LANGS_RES) if (reg.test(id)) return lang;\n\treturn null;\n}\nfunction getJsModuleType(id) {\n\tfor (const [reg, lang] of JS_LANGS_RES) if (reg.test(id)) return lang;\n\treturn null;\n}\nfunction formatLoadModuleType(id) {\n\tconst cssModuleType = getCssModuleType(id);\n\tif (cssModuleType) return cssModuleType;\n\tconst jsModuleType = getJsModuleType(id);\n\tif (jsModuleType) return jsModuleType;\n\treturn \"js\";\n}\nfunction formatTransformModuleType(id) {\n\treturn formatLoadModuleType(id);\n}\n\n//#endregion\n//#region src/farm/index.ts\nfunction getFarmPlugin(factory) {\n\treturn ((userOptions) => {\n\t\tconst plugins = toArray(factory(userOptions, { framework: \"farm\" })).map((rawPlugin) => {\n\t\t\tconst plugin = toFarmPlugin(rawPlugin, userOptions);\n\t\t\tif (rawPlugin.farm) Object.assign(plugin, rawPlugin.farm);\n\t\t\treturn plugin;\n\t\t});\n\t\treturn plugins.length === 1 ? plugins[0] : plugins;\n\t});\n}\nfunction toFarmPlugin(plugin, options) {\n\tconst farmPlugin = {\n\t\tname: plugin.name,\n\t\tpriority: convertEnforceToPriority(plugin.enforce)\n\t};\n\tif (plugin.farm) Object.keys(plugin.farm).forEach((key) => {\n\t\tconst value = plugin.farm[key];\n\t\tif (value) Reflect.set(farmPlugin, key, value);\n\t});\n\tif (plugin.buildStart) {\n\t\tconst _buildStart = plugin.buildStart;\n\t\tfarmPlugin.buildStart = { async executor(_, context) {\n\t\t\tawait _buildStart.call(createFarmContext(context));\n\t\t} };\n\t}\n\tif (plugin.resolveId) {\n\t\tconst _resolveId = plugin.resolveId;\n\t\tlet filters = [];\n\t\tif (options) filters = options?.filters ?? [];\n\t\tfarmPlugin.resolve = {\n\t\t\tfilters: {\n\t\t\t\tsources: filters.length ? filters : [\".*\"],\n\t\t\t\timporters: [\".*\"]\n\t\t\t},\n\t\t\tasync executor(params, context) {\n\t\t\t\tconst resolvedIdPath = path.resolve(params.importer ?? \"\");\n\t\t\t\tconst id = decodeStr(params.source);\n\t\t\t\tconst { handler, filter } = normalizeObjectHook(\"resolveId\", _resolveId);\n\t\t\t\tif (!filter(id)) return null;\n\t\t\t\tlet isEntry = false;\n\t\t\t\tif (isObject(params.kind) && \"entry\" in params.kind) isEntry = params.kind.entry === \"index\";\n\t\t\t\tconst farmContext = createFarmContext(context, resolvedIdPath);\n\t\t\t\tconst resolveIdResult = await handler.call(Object.assign(unpluginContext(context), farmContext), id, resolvedIdPath ?? null, { isEntry });\n\t\t\t\tif (isString(resolveIdResult)) return {\n\t\t\t\t\tresolvedPath: removeQuery(encodeStr(resolveIdResult)),\n\t\t\t\t\tquery: customParseQueryString(resolveIdResult),\n\t\t\t\t\tsideEffects: true,\n\t\t\t\t\texternal: false,\n\t\t\t\t\tmeta: {}\n\t\t\t\t};\n\t\t\t\tif (isObject(resolveIdResult)) return {\n\t\t\t\t\tresolvedPath: removeQuery(encodeStr(resolveIdResult?.id)),\n\t\t\t\t\tquery: customParseQueryString(resolveIdResult?.id),\n\t\t\t\t\tsideEffects: false,\n\t\t\t\t\texternal: Boolean(resolveIdResult?.external),\n\t\t\t\t\tmeta: {}\n\t\t\t\t};\n\t\t\t\tif (!isStartsWithSlash(params.source)) return null;\n\t\t\t}\n\t\t};\n\t}\n\tif (plugin.load) {\n\t\tconst _load = plugin.load;\n\t\tfarmPlugin.load = {\n\t\t\tfilters: { resolvedPaths: [\".*\"] },\n\t\t\tasync executor(params, context) {\n\t\t\t\tconst id = appendQuery(decodeStr(params.resolvedPath), params.query);\n\t\t\t\tconst loader = formatTransformModuleType(id);\n\t\t\t\tif (plugin.loadInclude && !plugin.loadInclude?.(id)) return null;\n\t\t\t\tconst { handler, filter } = normalizeObjectHook(\"load\", _load);\n\t\t\t\tif (!filter(id)) return null;\n\t\t\t\tconst farmContext = createFarmContext(context, id);\n\t\t\t\treturn {\n\t\t\t\t\tcontent: getContentValue(await handler.call(Object.assign(unpluginContext(context), farmContext), id)),\n\t\t\t\t\tmoduleType: loader\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tif (plugin.transform) {\n\t\tconst _transform = plugin.transform;\n\t\tfarmPlugin.transform = {\n\t\t\tfilters: {\n\t\t\t\tresolvedPaths: [\".*\"],\n\t\t\t\tmoduleTypes: [\".*\"]\n\t\t\t},\n\t\t\tasync executor(params, context) {\n\t\t\t\tconst id = appendQuery(decodeStr(params.resolvedPath), params.query);\n\t\t\t\tconst loader = formatTransformModuleType(id);\n\t\t\t\tif (plugin.transformInclude && !plugin.transformInclude(id)) return null;\n\t\t\t\tconst { handler, filter } = normalizeObjectHook(\"transform\", _transform);\n\t\t\t\tif (!filter(id, params.content)) return null;\n\t\t\t\tconst farmContext = createFarmContext(context, id);\n\t\t\t\tconst resource = await handler.call(Object.assign(unpluginContext(context), farmContext), params.content, id);\n\t\t\t\tif (resource && typeof resource !== \"string\") return {\n\t\t\t\t\tcontent: getContentValue(resource),\n\t\t\t\t\tmoduleType: loader,\n\t\t\t\t\tsourceMap: typeof resource.map === \"object\" && resource.map !== null ? JSON.stringify(resource.map) : void 0\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tif (plugin.watchChange) {\n\t\tconst _watchChange = plugin.watchChange;\n\t\tfarmPlugin.updateModules = { async executor(param, context) {\n\t\t\tconst updatePathContent = param.paths[0];\n\t\t\tconst ModifiedPath = updatePathContent[0];\n\t\t\tconst eventChange = convertWatchEventChange(updatePathContent[1]);\n\t\t\tawait _watchChange.call(createFarmContext(context), ModifiedPath, { event: eventChange });\n\t\t} };\n\t}\n\tif (plugin.buildEnd) {\n\t\tconst _buildEnd = plugin.buildEnd;\n\t\tfarmPlugin.buildEnd = { async executor(_, context) {\n\t\t\tawait _buildEnd.call(createFarmContext(context));\n\t\t} };\n\t}\n\tif (plugin.writeBundle) {\n\t\tconst _writeBundle = plugin.writeBundle;\n\t\tfarmPlugin.finish = { async executor() {\n\t\t\tawait _writeBundle();\n\t\t} };\n\t}\n\treturn farmPlugin;\n}\n\n//#endregion\n//#region src/rollup/index.ts\nfunction getRollupPlugin(factory) {\n\treturn ((userOptions) => {\n\t\tconst plugins = toArray(factory(userOptions, { framework: \"rollup\" })).map((plugin) => toRollupPlugin(plugin, \"rollup\"));\n\t\treturn plugins.length === 1 ? plugins[0] : plugins;\n\t});\n}\nfunction toRollupPlugin(plugin, key) {\n\tconst nativeFilter = key === \"rolldown\";\n\tif (plugin.resolveId && !nativeFilter && typeof plugin.resolveId === \"object\" && plugin.resolveId.filter) {\n\t\tconst resolveIdHook = plugin.resolveId;\n\t\tconst { handler, filter } = normalizeObjectHook(\"load\", resolveIdHook);\n\t\treplaceHookHandler(\"resolveId\", resolveIdHook, function(...args) {\n\t\t\tconst [id] = args;\n\t\t\tif (!supportNativeFilter(this, key) && !filter(id)) return;\n\t\t\treturn handler.apply(this, args);\n\t\t});\n\t}\n\tif (plugin.load && (plugin.loadInclude || !nativeFilter && typeof plugin.load === \"object\" && plugin.load.filter)) {\n\t\tconst loadHook = plugin.load;\n\t\tconst { handler, filter } = normalizeObjectHook(\"load\", loadHook);\n\t\treplaceHookHandler(\"load\", loadHook, function(...args) {\n\t\t\tconst [id] = args;\n\t\t\tif (plugin.loadInclude && !plugin.loadInclude(id)) return;\n\t\t\tif (!supportNativeFilter(this, key) && !filter(id)) return;\n\t\t\treturn handler.apply(this, args);\n\t\t});\n\t}\n\tif (plugin.transform && (plugin.transformInclude || !nativeFilter && typeof plugin.transform === \"object\" && plugin.transform.filter)) {\n\t\tconst transformHook = plugin.transform;\n\t\tconst { handler, filter } = normalizeObjectHook(\"transform\", transformHook);\n\t\treplaceHookHandler(\"transform\", transformHook, function(...args) {\n\t\t\tconst [code, id] = args;\n\t\t\tif (plugin.transformInclude && !plugin.transformInclude(id)) return;\n\t\t\tif (!supportNativeFilter(this, key) && !filter(id, code)) return;\n\t\t\treturn handler.apply(this, args);\n\t\t});\n\t}\n\tif (plugin[key]) Object.assign(plugin, plugin[key]);\n\treturn plugin;\n\tfunction replaceHookHandler(name, hook, handler) {\n\t\tif (typeof hook === \"function\") plugin[name] = handler;\n\t\telse hook.handler = handler;\n\t}\n}\nfunction supportNativeFilter(context, framework) {\n\tif (framework === \"vite\") return !!context?.meta?.viteVersion;\n\tif (framework === \"rolldown\") return true;\n\tconst rollupVersion = context?.meta?.rollupVersion;\n\tif (!rollupVersion) return false;\n\tconst [major, minor] = rollupVersion.split(\".\");\n\treturn Number(major) > 4 || Number(major) === 4 && Number(minor) >= 40;\n}\n\n//#endregion\n//#region src/rolldown/index.ts\nfunction getRolldownPlugin(factory) {\n\treturn ((userOptions) => {\n\t\tconst plugins = toArray(factory(userOptions, { framework: \"rolldown\" })).map((rawPlugin) => {\n\t\t\treturn toRollupPlugin(rawPlugin, \"rolldown\");\n\t\t});\n\t\treturn plugins.length === 1 ? plugins[0] : plugins;\n\t});\n}\n\n//#endregion\n//#region src/rspack/index.ts\nconst TRANSFORM_LOADER$1 = resolve(import.meta.dirname, \"rspack/loaders/transform.mjs\");\nconst LOAD_LOADER$1 = resolve(import.meta.dirname, \"rspack/loaders/load.mjs\");\nfunction getRspackPlugin(factory) {\n\treturn (userOptions) => {\n\t\treturn { apply(compiler) {\n\t\t\tconst VIRTUAL_MODULE_PREFIX = resolve(compiler.options.context ?? process.cwd(), \"node_modules/.virtual\", compiler.rspack.experiments.VirtualModulesPlugin ? \"\" : process.pid.toString());\n\t\t\tconst meta = {\n\t\t\t\tframework: \"rspack\",\n\t\t\t\trspack: { compiler }\n\t\t\t};\n\t\t\tconst rawPlugins = toArray(factory(userOptions, meta));\n\t\t\tfor (const rawPlugin of rawPlugins) {\n\t\t\t\tconst plugin = Object.assign(rawPlugin, {\n\t\t\t\t\t__unpluginMeta: meta,\n\t\t\t\t\t__virtualModulePrefix: VIRTUAL_MODULE_PREFIX\n\t\t\t\t});\n\t\t\t\tconst externalModules = /* @__PURE__ */ new Set();\n\t\t\t\tif (plugin.resolveId) {\n\t\t\t\t\tconst createPlugin = (plugin$1) => {\n\t\t\t\t\t\tif (compiler.rspack.experiments.VirtualModulesPlugin) return new compiler.rspack.experiments.VirtualModulesPlugin();\n\t\t\t\t\t\treturn new FakeVirtualModulesPlugin(plugin$1);\n\t\t\t\t\t};\n\t\t\t\t\tconst vfs = createPlugin(plugin);\n\t\t\t\t\tvfs.apply(compiler);\n\t\t\t\t\tconst vfsModules = /* @__PURE__ */ new Map();\n\t\t\t\t\tplugin.__vfsModules = vfsModules;\n\t\t\t\t\tplugin.__vfs = vfs;\n\t\t\t\t\tcompiler.hooks.compilation.tap(plugin.name, (compilation, { normalModuleFactory }) => {\n\t\t\t\t\t\tnormalModuleFactory.hooks.resolve.tapPromise(plugin.name, async (resolveData) => {\n\t\t\t\t\t\t\tconst id = normalizeAbsolutePath(resolveData.request);\n\t\t\t\t\t\t\tconst requestContext = resolveData.contextInfo;\n\t\t\t\t\t\t\tlet importer = requestContext.issuer !== \"\" ? requestContext.issuer : void 0;\n\t\t\t\t\t\t\tconst isEntry = requestContext.issuer === \"\";\n\t\t\t\t\t\t\tif (importer?.startsWith(plugin.__virtualModulePrefix)) importer = decodeURIComponent(importer.slice(plugin.__virtualModulePrefix.length));\n\t\t\t\t\t\t\tconst context = createBuildContext$1(compiler, compilation);\n\t\t\t\t\t\t\tlet error;\n\t\t\t\t\t\t\tconst pluginContext = {\n\t\t\t\t\t\t\t\terror(msg) {\n\t\t\t\t\t\t\t\t\tif (error == null) error = normalizeMessage$1(msg);\n\t\t\t\t\t\t\t\t\telse console.error(`unplugin/rspack: multiple errors returned from resolveId hook: ${msg}`);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\twarn(msg) {\n\t\t\t\t\t\t\t\t\tconsole.warn(`unplugin/rspack: warning from resolveId hook: ${msg}`);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst { handler, filter } = normalizeObjectHook(\"resolveId\", plugin.resolveId);\n\t\t\t\t\t\t\tif (!filter(id)) return;\n\t\t\t\t\t\t\tconst resolveIdResult = await handler.call({\n\t\t\t\t\t\t\t\t...context,\n\t\t\t\t\t\t\t\t...pluginContext\n\t\t\t\t\t\t\t}, id, importer, { isEntry });\n\t\t\t\t\t\t\tif (error != null) throw error;\n\t\t\t\t\t\t\tif (resolveIdResult == null) return;\n\t\t\t\t\t\t\tlet resolved = typeof resolveIdResult === \"string\" ? resolveIdResult : resolveIdResult.id;\n\t\t\t\t\t\t\tif (typeof resolveIdResult === \"string\" ? false : resolveIdResult.external === true) externalModules.add(resolved);\n\t\t\t\t\t\t\tlet isVirtual = true;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t(compiler.inputFileSystem?.statSync ?? fs.statSync)(resolved);\n\t\t\t\t\t\t\t\tisVirtual = false;\n\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\tisVirtual = !isVirtualModuleId(resolved, plugin);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isVirtual) {\n\t\t\t\t\t\t\t\tconst encodedVirtualPath = encodeVirtualModuleId(resolved, plugin);\n\t\t\t\t\t\t\t\tif (!vfsModules.has(resolved)) {\n\t\t\t\t\t\t\t\t\tconst fsPromise = Promise.resolve(vfs.writeModule(encodedVirtualPath, \"\"));\n\t\t\t\t\t\t\t\t\tvfsModules.set(resolved, fsPromise);\n\t\t\t\t\t\t\t\t\tawait fsPromise;\n\t\t\t\t\t\t\t\t} else await vfsModules.get(resolved);\n\t\t\t\t\t\t\t\tresolved = encodedVirtualPath;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresolveData.request = resolved;\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (plugin.load) compiler.options.module.rules.unshift({\n\t\t\t\t\tenforce: plugin.enforce,\n\t\t\t\t\tinclude(id) {\n\t\t\t\t\t\tif (isVirtualModuleId(id, plugin)) id = decodeVirtualModuleId(id, plugin);\n\t\t\t\t\t\tif (plugin.loadInclude && !plugin.loadInclude(id)) return false;\n\t\t\t\t\t\tconst { filter } = normalizeObjectHook(\"load\", plugin.load);\n\t\t\t\t\t\tif (!filter(id)) return false;\n\t\t\t\t\t\treturn !externalModules.has(id);\n\t\t\t\t\t},\n\t\t\t\t\tuse: [{\n\t\t\t\t\t\tloader: LOAD_LOADER$1,\n\t\t\t\t\t\toptions: { plugin }\n\t\t\t\t\t}],\n\t\t\t\t\ttype: \"javascript/auto\"\n\t\t\t\t});\n\t\t\t\tif (plugin.transform) compiler.options.module.rules.unshift({\n\t\t\t\t\tenforce: plugin.enforce,\n\t\t\t\t\tuse(data) {\n\t\t\t\t\t\treturn transformUse(data, plugin, TRANSFORM_LOADER$1);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (plugin.rspack) plugin.rspack(compiler);\n\t\t\t\tif (plugin.watchChange || plugin.buildStart) compiler.hooks.make.tapPromise(plugin.name, async (compilation) => {\n\t\t\t\t\tconst context = createBuildContext$1(compiler, compilation);\n\t\t\t\t\tif (plugin.watchChange && (compiler.modifiedFiles || compiler.removedFiles)) {\n\t\t\t\t\t\tconst promises = [];\n\t\t\t\t\t\tif (compiler.modifiedFiles) compiler.modifiedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: \"update\" }))));\n\t\t\t\t\t\tif (compiler.removedFiles) compiler.removedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: \"delete\" }))));\n\t\t\t\t\t\tawait Promise.all(promises);\n\t\t\t\t\t}\n\t\t\t\t\tif (plugin.buildStart) return await plugin.buildStart.call(context);\n\t\t\t\t});\n\t\t\t\tif (plugin.buildEnd) compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => {\n\t\t\t\t\tawait plugin.buildEnd.call(createBuildContext$1(compiler, compilation));\n\t\t\t\t});\n\t\t\t\tif (plugin.writeBundle) compiler.hooks.afterEmit.tapPromise(plugin.name, async () => {\n\t\t\t\t\tawait plugin.writeBundle();\n\t\t\t\t});\n\t\t\t}\n\t\t} };\n\t};\n}\n\n//#endregion\n//#region src/unloader/index.ts\nfunction getUnloaderPlugin(factory) {\n\treturn ((userOptions) => {\n\t\tconst plugins = toArray(factory(userOptions, { framework: \"unloader\" })).map((rawPlugin) => {\n\t\t\treturn toRollupPlugin(rawPlugin, \"unloader\");\n\t\t});\n\t\treturn plugins.length === 1 ? plugins[0] : plugins;\n\t});\n}\n\n//#endregion\n//#region src/vite/index.ts\nfunction getVitePlugin(factory) {\n\treturn ((userOptions) => {\n\t\tconst plugins = toArray(factory(userOptions, { framework: \"vite\" })).map((rawPlugin) => {\n\t\t\treturn toRollupPlugin(rawPlugin, \"vite\");\n\t\t});\n\t\treturn plugins.length === 1 ? plugins[0] : plugins;\n\t});\n}\n\n//#endregion\n//#region src/webpack/index.ts\nconst TRANSFORM_LOADER = resolve(import.meta.dirname, \"webpack/loaders/transform.mjs\");\nconst LOAD_LOADER = resolve(import.meta.dirname, \"webpack/loaders/load.mjs\");\nfunction getWebpackPlugin(factory) {\n\treturn (userOptions) => {\n\t\treturn { apply(compiler) {\n\t\t\tconst VIRTUAL_MODULE_PREFIX = resolve(compiler.options.context ?? process$1.cwd(), \"_virtual_\");\n\t\t\tconst meta = {\n\t\t\t\tframework: \"webpack\",\n\t\t\t\twebpack: { compiler }\n\t\t\t};\n\t\t\tconst rawPlugins = toArray(factory(userOptions, meta));\n\t\t\tfor (const rawPlugin of rawPlugins) {\n\t\t\t\tconst plugin = Object.assign(rawPlugin, {\n\t\t\t\t\t__unpluginMeta: meta,\n\t\t\t\t\t__virtualModulePrefix: VIRTUAL_MODULE_PREFIX\n\t\t\t\t});\n\t\t\t\tconst externalModules = /* @__PURE__ */ new Set();\n\t\t\t\tif (plugin.resolveId) {\n\t\t\t\t\tlet vfs = compiler.options.plugins.find((i) => i instanceof VirtualModulesPlugin);\n\t\t\t\t\tif (!vfs) {\n\t\t\t\t\t\tvfs = new VirtualModulesPlugin();\n\t\t\t\t\t\tcompiler.options.plugins.push(vfs);\n\t\t\t\t\t}\n\t\t\t\t\tconst vfsModules = /* @__PURE__ */ new Set();\n\t\t\t\t\tplugin.__vfsModules = vfsModules;\n\t\t\t\t\tplugin.__vfs = vfs;\n\t\t\t\t\tconst resolverPlugin = { apply(resolver) {\n\t\t\t\t\t\tconst target = resolver.ensureHook(\"resolve\");\n\t\t\t\t\t\tresolver.getHook(\"resolve\").tapAsync(plugin.name, async (request, resolveContext, callback) => {\n\t\t\t\t\t\t\tif (!request.request) return callback();\n\t\t\t\t\t\t\tif (normalizeAbsolutePath(request.request).startsWith(plugin.__virtualModulePrefix)) return callback();\n\t\t\t\t\t\t\tconst id = normalizeAbsolutePath(request.request);\n\t\t\t\t\t\t\tconst requestContext = request.context;\n\t\t\t\t\t\t\tlet importer = requestContext.issuer !== \"\" ? requestContext.issuer : void 0;\n\t\t\t\t\t\t\tconst isEntry = requestContext.issuer === \"\";\n\t\t\t\t\t\t\tif (importer?.startsWith(plugin.__virtualModulePrefix)) importer = decodeURIComponent(importer.slice(plugin.__virtualModulePrefix.length));\n\t\t\t\t\t\t\tconst fileDependencies = /* @__PURE__ */ new Set();\n\t\t\t\t\t\t\tconst context = createBuildContext({\n\t\t\t\t\t\t\t\taddWatchFile(file) {\n\t\t\t\t\t\t\t\t\tfileDependencies.add(file);\n\t\t\t\t\t\t\t\t\tresolveContext.fileDependencies?.add(file);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tgetWatchFiles() {\n\t\t\t\t\t\t\t\t\treturn Array.from(fileDependencies);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, compiler);\n\t\t\t\t\t\t\tlet error;\n\t\t\t\t\t\t\tconst pluginContext = {\n\t\t\t\t\t\t\t\terror(msg) {\n\t\t\t\t\t\t\t\t\tif (error == null) error = normalizeMessage(msg);\n\t\t\t\t\t\t\t\t\telse console.error(`unplugin/webpack: multiple errors returned from resolveId hook: ${msg}`);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\twarn(msg) {\n\t\t\t\t\t\t\t\t\tconsole.warn(`unplugin/webpack: warning from resolveId hook: ${msg}`);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst { handler, filter } = normalizeObjectHook(\"resolveId\", plugin.resolveId);\n\t\t\t\t\t\t\tif (!filter(id)) return callback();\n\t\t\t\t\t\t\tconst resolveIdResult = await handler.call({\n\t\t\t\t\t\t\t\t...context,\n\t\t\t\t\t\t\t\t...pluginContext\n\t\t\t\t\t\t\t}, id, importer, { isEntry });\n\t\t\t\t\t\t\tif (error != null) return callback(error);\n\t\t\t\t\t\t\tif (resolveIdResult == null) return callback();\n\t\t\t\t\t\t\tlet resolved = typeof resolveIdResult === \"string\" ? resolveIdResult : resolveIdResult.id;\n\t\t\t\t\t\t\tif (typeof resolveIdResult === \"string\" ? false : resolveIdResult.external === true) externalModules.add(resolved);\n\t\t\t\t\t\t\tif (!fs.existsSync(resolved)) {\n\t\t\t\t\t\t\t\tresolved = normalizeAbsolutePath(plugin.__virtualModulePrefix + encodeURIComponent(resolved));\n\t\t\t\t\t\t\t\tif (!vfsModules.has(resolved)) {\n\t\t\t\t\t\t\t\t\tplugin.__vfs.writeModule(resolved, \"\");\n\t\t\t\t\t\t\t\t\tvfsModules.add(resolved);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst newRequest = {\n\t\t\t\t\t\t\t\t...request,\n\t\t\t\t\t\t\t\trequest: resolved\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tresolver.doResolve(target, newRequest, null, resolveContext, callback);\n\t\t\t\t\t\t});\n\t\t\t\t\t} };\n\t\t\t\t\tcompiler.options.resolve.plugins = compiler.options.resolve.plugins || [];\n\t\t\t\t\tcompiler.options.resolve.plugins.push(resolverPlugin);\n\t\t\t\t}\n\t\t\t\tif (plugin.load) compiler.options.module.rules.unshift({\n\t\t\t\t\tinclude(id) {\n\t\t\t\t\t\treturn shouldLoad(id, plugin, externalModules);\n\t\t\t\t\t},\n\t\t\t\t\tenforce: plugin.enforce,\n\t\t\t\t\tuse: [{\n\t\t\t\t\t\tloader: LOAD_LOADER,\n\t\t\t\t\t\toptions: { plugin }\n\t\t\t\t\t}],\n\t\t\t\t\ttype: \"javascript/auto\"\n\t\t\t\t});\n\t\t\t\tif (plugin.transform) compiler.options.module.rules.unshift({\n\t\t\t\t\tenforce: plugin.enforce,\n\t\t\t\t\tuse(data) {\n\t\t\t\t\t\treturn transformUse(data, plugin, TRANSFORM_LOADER);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (plugin.webpack) plugin.webpack(compiler);\n\t\t\t\tif (plugin.watchChange || plugin.buildStart) compiler.hooks.make.tapPromise(plugin.name, async (compilation) => {\n\t\t\t\t\tconst context = createBuildContext(contextOptionsFromCompilation(compilation), compiler, compilation);\n\t\t\t\t\tif (plugin.watchChange && (compiler.modifiedFiles || compiler.removedFiles)) {\n\t\t\t\t\t\tconst promises = [];\n\t\t\t\t\t\tif (compiler.modifiedFiles) compiler.modifiedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: \"update\" }))));\n\t\t\t\t\t\tif (compiler.removedFiles) compiler.removedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: \"delete\" }))));\n\t\t\t\t\t\tawait Promise.all(promises);\n\t\t\t\t\t}\n\t\t\t\t\tif (plugin.buildStart) return await plugin.buildStart.call(context);\n\t\t\t\t});\n\t\t\t\tif (plugin.buildEnd) compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => {\n\t\t\t\t\tawait plugin.buildEnd.call(createBuildContext(contextOptionsFromCompilation(compilation), compiler, compilation));\n\t\t\t\t});\n\t\t\t\tif (plugin.writeBundle) compiler.hooks.afterEmit.tapPromise(plugin.name, async () => {\n\t\t\t\t\tawait plugin.writeBundle();\n\t\t\t\t});\n\t\t\t}\n\t\t} };\n\t};\n}\nfunction shouldLoad(id, plugin, externalModules) {\n\tif (id.startsWith(plugin.__virtualModulePrefix)) id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length));\n\tif (plugin.loadInclude && !plugin.loadInclude(id)) return false;\n\tconst { filter } = normalizeObjectHook(\"load\", plugin.load);\n\tif (!filter(id)) return false;\n\treturn !externalModules.has(id);\n}\n\n//#endregion\n//#region src/define.ts\nfunction createUnplugin(factory) {\n\treturn {\n\t\tget esbuild() {\n\t\t\treturn getEsbuildPlugin(factory);\n\t\t},\n\t\tget rollup() {\n\t\t\treturn getRollupPlugin(factory);\n\t\t},\n\t\tget vite() {\n\t\t\treturn getVitePlugin(factory);\n\t\t},\n\t\tget rolldown() {\n\t\t\treturn getRolldownPlugin(factory);\n\t\t},\n\t\tget webpack() {\n\t\t\treturn getWebpackPlugin(factory);\n\t\t},\n\t\tget rspack() {\n\t\t\treturn getRspackPlugin(factory);\n\t\t},\n\t\tget farm() {\n\t\t\treturn getFarmPlugin(factory);\n\t\t},\n\t\tget unloader() {\n\t\t\treturn getUnloaderPlugin(factory);\n\t\t},\n\t\tget bun() {\n\t\t\treturn getBunPlugin(factory);\n\t\t},\n\t\tget raw() {\n\t\t\treturn factory;\n\t\t}\n\t};\n}\nfunction createEsbuildPlugin(factory) {\n\treturn getEsbuildPlugin(factory);\n}\nfunction createRollupPlugin(factory) {\n\treturn getRollupPlugin(factory);\n}\nfunction createVitePlugin(factory) {\n\treturn getVitePlugin(factory);\n}\nfunction createRolldownPlugin(factory) {\n\treturn getRolldownPlugin(factory);\n}\nfunction createWebpackPlugin(factory) {\n\treturn getWebpackPlugin(factory);\n}\nfunction createRspackPlugin(factory) {\n\treturn getRspackPlugin(factory);\n}\nfunction createFarmPlugin(factory) {\n\treturn getFarmPlugin(factory);\n}\nfunction createUnloaderPlugin(factory) {\n\treturn getUnloaderPlugin(factory);\n}\nfunction createBunPlugin(factory) {\n\treturn getBunPlugin(factory);\n}\n\n//#endregion\nexport { createBunPlugin, createEsbuildPlugin, createFarmPlugin, createRolldownPlugin, createRollupPlugin, createRspackPlugin, createUnloaderPlugin, createUnplugin, createVitePlugin, createWebpackPlugin, setParseImpl };"],"x_google_ignoreList":[0],"mappings":"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"}
@@ -1,114 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
2
- const require_index = require('../../../../picomatch@4.0.3/node_modules/picomatch/index.cjs');
3
- let node_path = require("node:path");
4
-
5
- //#region ../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.mjs
6
- var import_picomatch = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index.default, 1);
7
- function toArray(array) {
8
- array = array || [];
9
- if (Array.isArray(array)) return array;
10
- return [array];
11
- }
12
- const BACKSLASH_REGEX = /\\/g;
13
- function normalize$1(path$1) {
14
- return path$1.replace(BACKSLASH_REGEX, "/");
15
- }
16
- const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Z]:)?[/\\|])/i;
17
- function isAbsolute$1(path$1) {
18
- return ABSOLUTE_PATH_REGEX.test(path$1);
19
- }
20
- function getMatcherString(glob, cwd) {
21
- if (glob.startsWith("**") || isAbsolute$1(glob)) return normalize$1(glob);
22
- return normalize$1((0, node_path.resolve)(cwd, glob));
23
- }
24
- function patternToIdFilter(pattern) {
25
- if (pattern instanceof RegExp) return (id) => {
26
- const normalizedId = normalize$1(id);
27
- const result = pattern.test(normalizedId);
28
- pattern.lastIndex = 0;
29
- return result;
30
- };
31
- const matcher = (0, import_picomatch.default)(getMatcherString(pattern, process.cwd()), { dot: true });
32
- return (id) => {
33
- return matcher(normalize$1(id));
34
- };
35
- }
36
- function patternToCodeFilter(pattern) {
37
- if (pattern instanceof RegExp) return (code) => {
38
- const result = pattern.test(code);
39
- pattern.lastIndex = 0;
40
- return result;
41
- };
42
- return (code) => code.includes(pattern);
43
- }
44
- function createFilter(exclude, include) {
45
- if (!exclude && !include) return;
46
- return (input) => {
47
- if (exclude?.some((filter) => filter(input))) return false;
48
- if (include?.some((filter) => filter(input))) return true;
49
- return !(include && include.length > 0);
50
- };
51
- }
52
- function normalizeFilter(filter) {
53
- if (typeof filter === "string" || filter instanceof RegExp) return { include: [filter] };
54
- if (Array.isArray(filter)) return { include: filter };
55
- return {
56
- exclude: filter.exclude ? toArray(filter.exclude) : void 0,
57
- include: filter.include ? toArray(filter.include) : void 0
58
- };
59
- }
60
- function createIdFilter(filter) {
61
- if (!filter) return;
62
- const { exclude, include } = normalizeFilter(filter);
63
- const excludeFilter = exclude?.map(patternToIdFilter);
64
- const includeFilter = include?.map(patternToIdFilter);
65
- return createFilter(excludeFilter, includeFilter);
66
- }
67
- function createCodeFilter(filter) {
68
- if (!filter) return;
69
- const { exclude, include } = normalizeFilter(filter);
70
- const excludeFilter = exclude?.map(patternToCodeFilter);
71
- const includeFilter = include?.map(patternToCodeFilter);
72
- return createFilter(excludeFilter, includeFilter);
73
- }
74
- function createFilterForId(filter) {
75
- const filterFunction = createIdFilter(filter);
76
- return filterFunction ? (id) => !!filterFunction(id) : void 0;
77
- }
78
- function createFilterForTransform(idFilter, codeFilter) {
79
- if (!idFilter && !codeFilter) return;
80
- const idFilterFunction = createIdFilter(idFilter);
81
- const codeFilterFunction = createCodeFilter(codeFilter);
82
- return (id, code) => {
83
- let fallback = true;
84
- if (idFilterFunction) fallback &&= idFilterFunction(id);
85
- if (!fallback) return false;
86
- if (codeFilterFunction) fallback &&= codeFilterFunction(code);
87
- return fallback;
88
- };
89
- }
90
- function normalizeObjectHook(name, hook) {
91
- let handler;
92
- let filter;
93
- if (typeof hook === "function") handler = hook;
94
- else {
95
- handler = hook.handler;
96
- const hookFilter = hook.filter;
97
- if (name === "resolveId" || name === "load") filter = createFilterForId(hookFilter?.id);
98
- else filter = createFilterForTransform(hookFilter?.id, hookFilter?.code);
99
- }
100
- return {
101
- handler,
102
- filter: filter || (() => true)
103
- };
104
- }
105
- let parseImpl;
106
- function parse(code, opts = {}) {
107
- if (!parseImpl) throw new Error("Parse implementation is not set. Please call setParseImpl first.");
108
- return parseImpl(code, opts);
109
- }
110
-
111
- //#endregion
112
- exports.normalizeObjectHook = normalizeObjectHook;
113
- exports.parse = parse;
114
- exports.toArray = toArray;
@@ -1,113 +0,0 @@
1
- import { __toESM } from "../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_picomatch } from "../../../../picomatch@4.0.3/node_modules/picomatch/index.mjs";
3
- import { resolve } from "node:path";
4
-
5
- //#region ../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.mjs
6
- var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
7
- function toArray(array) {
8
- array = array || [];
9
- if (Array.isArray(array)) return array;
10
- return [array];
11
- }
12
- const BACKSLASH_REGEX = /\\/g;
13
- function normalize$1(path$1) {
14
- return path$1.replace(BACKSLASH_REGEX, "/");
15
- }
16
- const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Z]:)?[/\\|])/i;
17
- function isAbsolute$1(path$1) {
18
- return ABSOLUTE_PATH_REGEX.test(path$1);
19
- }
20
- function getMatcherString(glob, cwd) {
21
- if (glob.startsWith("**") || isAbsolute$1(glob)) return normalize$1(glob);
22
- return normalize$1(resolve(cwd, glob));
23
- }
24
- function patternToIdFilter(pattern) {
25
- if (pattern instanceof RegExp) return (id) => {
26
- const normalizedId = normalize$1(id);
27
- const result = pattern.test(normalizedId);
28
- pattern.lastIndex = 0;
29
- return result;
30
- };
31
- const matcher = (0, import_picomatch.default)(getMatcherString(pattern, process.cwd()), { dot: true });
32
- return (id) => {
33
- return matcher(normalize$1(id));
34
- };
35
- }
36
- function patternToCodeFilter(pattern) {
37
- if (pattern instanceof RegExp) return (code) => {
38
- const result = pattern.test(code);
39
- pattern.lastIndex = 0;
40
- return result;
41
- };
42
- return (code) => code.includes(pattern);
43
- }
44
- function createFilter(exclude, include) {
45
- if (!exclude && !include) return;
46
- return (input) => {
47
- if (exclude?.some((filter) => filter(input))) return false;
48
- if (include?.some((filter) => filter(input))) return true;
49
- return !(include && include.length > 0);
50
- };
51
- }
52
- function normalizeFilter(filter) {
53
- if (typeof filter === "string" || filter instanceof RegExp) return { include: [filter] };
54
- if (Array.isArray(filter)) return { include: filter };
55
- return {
56
- exclude: filter.exclude ? toArray(filter.exclude) : void 0,
57
- include: filter.include ? toArray(filter.include) : void 0
58
- };
59
- }
60
- function createIdFilter(filter) {
61
- if (!filter) return;
62
- const { exclude, include } = normalizeFilter(filter);
63
- const excludeFilter = exclude?.map(patternToIdFilter);
64
- const includeFilter = include?.map(patternToIdFilter);
65
- return createFilter(excludeFilter, includeFilter);
66
- }
67
- function createCodeFilter(filter) {
68
- if (!filter) return;
69
- const { exclude, include } = normalizeFilter(filter);
70
- const excludeFilter = exclude?.map(patternToCodeFilter);
71
- const includeFilter = include?.map(patternToCodeFilter);
72
- return createFilter(excludeFilter, includeFilter);
73
- }
74
- function createFilterForId(filter) {
75
- const filterFunction = createIdFilter(filter);
76
- return filterFunction ? (id) => !!filterFunction(id) : void 0;
77
- }
78
- function createFilterForTransform(idFilter, codeFilter) {
79
- if (!idFilter && !codeFilter) return;
80
- const idFilterFunction = createIdFilter(idFilter);
81
- const codeFilterFunction = createCodeFilter(codeFilter);
82
- return (id, code) => {
83
- let fallback = true;
84
- if (idFilterFunction) fallback &&= idFilterFunction(id);
85
- if (!fallback) return false;
86
- if (codeFilterFunction) fallback &&= codeFilterFunction(code);
87
- return fallback;
88
- };
89
- }
90
- function normalizeObjectHook(name, hook) {
91
- let handler;
92
- let filter;
93
- if (typeof hook === "function") handler = hook;
94
- else {
95
- handler = hook.handler;
96
- const hookFilter = hook.filter;
97
- if (name === "resolveId" || name === "load") filter = createFilterForId(hookFilter?.id);
98
- else filter = createFilterForTransform(hookFilter?.id, hookFilter?.code);
99
- }
100
- return {
101
- handler,
102
- filter: filter || (() => true)
103
- };
104
- }
105
- let parseImpl;
106
- function parse(code, opts = {}) {
107
- if (!parseImpl) throw new Error("Parse implementation is not set. Please call setParseImpl first.");
108
- return parseImpl(code, opts);
109
- }
110
-
111
- //#endregion
112
- export { normalizeObjectHook, parse, toArray };
113
- //# sourceMappingURL=parse-CRORloGP.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-CRORloGP.mjs","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.mjs"],"sourcesContent":["import { resolve } from \"node:path\";\nimport picomatch from \"picomatch\";\n\n//#region src/utils/general.ts\nfunction toArray(array) {\n\tarray = array || [];\n\tif (Array.isArray(array)) return array;\n\treturn [array];\n}\n\n//#endregion\n//#region src/utils/filter.ts\nconst BACKSLASH_REGEX = /\\\\/g;\nfunction normalize$1(path$1) {\n\treturn path$1.replace(BACKSLASH_REGEX, \"/\");\n}\nconst ABSOLUTE_PATH_REGEX = /^(?:\\/|(?:[A-Z]:)?[/\\\\|])/i;\nfunction isAbsolute$1(path$1) {\n\treturn ABSOLUTE_PATH_REGEX.test(path$1);\n}\nfunction getMatcherString(glob, cwd) {\n\tif (glob.startsWith(\"**\") || isAbsolute$1(glob)) return normalize$1(glob);\n\treturn normalize$1(resolve(cwd, glob));\n}\nfunction patternToIdFilter(pattern) {\n\tif (pattern instanceof RegExp) return (id) => {\n\t\tconst normalizedId = normalize$1(id);\n\t\tconst result = pattern.test(normalizedId);\n\t\tpattern.lastIndex = 0;\n\t\treturn result;\n\t};\n\tconst matcher = picomatch(getMatcherString(pattern, process.cwd()), { dot: true });\n\treturn (id) => {\n\t\treturn matcher(normalize$1(id));\n\t};\n}\nfunction patternToCodeFilter(pattern) {\n\tif (pattern instanceof RegExp) return (code) => {\n\t\tconst result = pattern.test(code);\n\t\tpattern.lastIndex = 0;\n\t\treturn result;\n\t};\n\treturn (code) => code.includes(pattern);\n}\nfunction createFilter(exclude, include) {\n\tif (!exclude && !include) return;\n\treturn (input) => {\n\t\tif (exclude?.some((filter) => filter(input))) return false;\n\t\tif (include?.some((filter) => filter(input))) return true;\n\t\treturn !(include && include.length > 0);\n\t};\n}\nfunction normalizeFilter(filter) {\n\tif (typeof filter === \"string\" || filter instanceof RegExp) return { include: [filter] };\n\tif (Array.isArray(filter)) return { include: filter };\n\treturn {\n\t\texclude: filter.exclude ? toArray(filter.exclude) : void 0,\n\t\tinclude: filter.include ? toArray(filter.include) : void 0\n\t};\n}\nfunction createIdFilter(filter) {\n\tif (!filter) return;\n\tconst { exclude, include } = normalizeFilter(filter);\n\tconst excludeFilter = exclude?.map(patternToIdFilter);\n\tconst includeFilter = include?.map(patternToIdFilter);\n\treturn createFilter(excludeFilter, includeFilter);\n}\nfunction createCodeFilter(filter) {\n\tif (!filter) return;\n\tconst { exclude, include } = normalizeFilter(filter);\n\tconst excludeFilter = exclude?.map(patternToCodeFilter);\n\tconst includeFilter = include?.map(patternToCodeFilter);\n\treturn createFilter(excludeFilter, includeFilter);\n}\nfunction createFilterForId(filter) {\n\tconst filterFunction = createIdFilter(filter);\n\treturn filterFunction ? (id) => !!filterFunction(id) : void 0;\n}\nfunction createFilterForTransform(idFilter, codeFilter) {\n\tif (!idFilter && !codeFilter) return;\n\tconst idFilterFunction = createIdFilter(idFilter);\n\tconst codeFilterFunction = createCodeFilter(codeFilter);\n\treturn (id, code) => {\n\t\tlet fallback = true;\n\t\tif (idFilterFunction) fallback &&= idFilterFunction(id);\n\t\tif (!fallback) return false;\n\t\tif (codeFilterFunction) fallback &&= codeFilterFunction(code);\n\t\treturn fallback;\n\t};\n}\nfunction normalizeObjectHook(name, hook) {\n\tlet handler;\n\tlet filter;\n\tif (typeof hook === \"function\") handler = hook;\n\telse {\n\t\thandler = hook.handler;\n\t\tconst hookFilter = hook.filter;\n\t\tif (name === \"resolveId\" || name === \"load\") filter = createFilterForId(hookFilter?.id);\n\t\telse filter = createFilterForTransform(hookFilter?.id, hookFilter?.code);\n\t}\n\treturn {\n\t\thandler,\n\t\tfilter: filter || (() => true)\n\t};\n}\n\n//#endregion\n//#region src/utils/parse.ts\nlet parseImpl;\nfunction parse(code, opts = {}) {\n\tif (!parseImpl) throw new Error(\"Parse implementation is not set. Please call setParseImpl first.\");\n\treturn parseImpl(code, opts);\n}\nfunction setParseImpl(customParse) {\n\tparseImpl = customParse;\n}\n\n//#endregion\nexport { toArray as i, setParseImpl as n, normalizeObjectHook as r, parse as t };"],"x_google_ignoreList":[0],"mappings":"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"}