UNPKG

unplugin-typegpu

Version:

Build plugins for TypeGPU, enabling seamless JavaScript -> WGSL transpilation and improved debugging.

2 lines 733 B
import{a as i,h as p,i as l}from"./chunk-V4Q4PLLO.js";import*as u from"@babel/standalone";import c from"defu";var x=s=>{let o=c(s,i),r=o.include;if(!(r instanceof RegExp))throw new Error("Unsupported 'include' options in Bun plugin. Please provide a single regular expression");if(o.exclude)throw new Error("Unsupported 'exclude' option in Bun plugin");return{name:"unplugin-typegpu",setup(a){a.onLoad({filter:r},async e=>{let n=await Bun.file(e.path).text();if(p.every(d=>!d.test(n)))return{contents:n,loader:e.loader};let t=u.transform(n,{presets:[["typescript",{allowDeclareFields:!0}]],filename:e.path,plugins:[l]}).code;return{contents:t!=null?t:n,loader:e.loader}})}}};export{x as a}; //# sourceMappingURL=chunk-EESBB3Y4.js.map