all data hide
NPM Installation / build (16.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (16.x, windows-latest) (push) Has been cancelled
NPM Installation / build (17.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (17.x, windows-latest) (push) Has been cancelled
NPM Installation / build (18.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (18.x, windows-latest) (push) Has been cancelled

This commit is contained in:
2026-06-25 09:44:52 +07:00
parent 2f289fb09e
commit d26db06f74
20660 changed files with 1815162 additions and 41 deletions
+27
View File
@@ -0,0 +1,27 @@
import { r as normalizeObjectHook } from "../../parse-DN2jPtpt.mjs";
import { t as normalizeAbsolutePath } from "../../webpack-like-Djrmy9eu.mjs";
import { n as createContext, t as createBuildContext } from "../../context-CKhLGGrj.mjs";
import { i as isVirtualModuleId, n as decodeVirtualModuleId } from "../../utils-BMHLEWml.mjs";
//#region src/rspack/loaders/load.ts
async function load(source, map) {
const callback = this.async();
const { plugin } = this.query;
let id = this.resource;
if (!plugin?.load || !id) return callback(null, source, map);
if (isVirtualModuleId(id, plugin)) id = decodeVirtualModuleId(id, plugin);
const context = createContext(this);
const { handler } = normalizeObjectHook("load", plugin.load);
try {
const res = await handler.call(Object.assign({}, this._compilation && createBuildContext(this._compiler, this._compilation, this), context), normalizeAbsolutePath(id));
if (res == null) callback(null, source, map);
else if (typeof res !== "string") callback(null, res.code, res.map ?? map);
else callback(null, res, map);
} catch (error) {
if (error instanceof Error) callback(error);
else callback(new Error(String(error)));
}
}
//#endregion
export { load as default };