This repository has been archived on 2026-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
nyx/node_modules/unplugin/dist/context-CKhLGGrj.mjs
Nico e2667f8e12 Initial nyx project — fork of hermes-frontend
Forked from hermes-frontend, stripped openclaw/bun specifics:
- Auth tokens: openclaw_session -> nyx_session
- Vite proxy: localhost:3003 -> localhost:8000 (assay)
- Prod WS: wss://assay.loop42.de/ws
- Workspace paths: removed openclaw-specific paths
- Added missing deps: @heroicons/vue, overlayscrollbars-vue
- Branding: title -> nyx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:23:27 +02:00

51 lines
1.5 KiB
JavaScript

import { t as parse } from "./parse-DN2jPtpt.mjs";
import { resolve } from "node:path";
import { Buffer } from "node:buffer";
//#region src/rspack/context.ts
function createBuildContext(compiler, compilation, loaderContext, inputSourceMap) {
return {
getNativeBuildContext() {
return {
framework: "rspack",
compiler,
compilation,
loaderContext,
inputSourceMap
};
},
addWatchFile(file) {
const resolvedPath = resolve(process.cwd(), file);
compilation.fileDependencies.add(resolvedPath);
loaderContext?.addDependency(resolvedPath);
},
getWatchFiles() {
return Array.from(compilation.fileDependencies);
},
parse,
emitFile(emittedFile) {
const outFileName = emittedFile.fileName || emittedFile.name;
if (emittedFile.source && outFileName) {
const { sources } = compilation.compiler.webpack;
compilation.emitAsset(outFileName, new sources.RawSource(typeof emittedFile.source === "string" ? emittedFile.source : Buffer.from(emittedFile.source)));
}
}
};
}
function createContext(loader) {
return {
error: (error) => loader.emitError(normalizeMessage(error)),
warn: (message) => loader.emitWarning(normalizeMessage(message))
};
}
function normalizeMessage(error) {
const err = new Error(typeof error === "string" ? error : error.message);
if (typeof error === "object") {
err.stack = error.stack;
err.cause = error.meta;
}
return err;
}
//#endregion
export { createContext as n, normalizeMessage as r, createBuildContext as t };