Files
vercel__eve/apps/docs/scripts/wgsl-node-loader.mjs
christopherkindl 48d5aebcd3 feat(docs): redesign landing page (#421)
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
Signed-off-by: Timo Lins <me@timo.sh>
Signed-off-by: matiasngf <matiasngf@hotmail.com>
Co-authored-by: Timo Lins <me@timo.sh>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Matias Gonzalez <matiasngf@hotmail.com>
2026-06-30 03:22:44 +02:00

15 lines
435 B
JavaScript

import { fileURLToPath } from "node:url";
import { resolveShader } from "@vgpu/wgsl/runtime";
export async function load(url, context, nextLoad) {
if (url.endsWith(".wgsl")) {
const { wgsl } = await resolveShader({ entry: fileURLToPath(url), validate: false });
return {
format: "module",
shortCircuit: true,
source: `export default ${JSON.stringify(wgsl)};`,
};
}
return nextLoad(url, context);
}