nvm fuck them kids

This commit is contained in:
Rowan 2025-04-22 01:22:09 -05:00
parent 4f2d2e5863
commit e1ab30a119

View file

@ -1,15 +1,12 @@
import fs from 'node:fs/promises'
export const wgsl = ({ filterWith, filterExtension }) => ({
export const wgsl = () => ({
name: 'esbuild-plugin-wgsl',
setup(build) {
const filter = filterExtension || true ? /\.wgsl$/ : /.*/
build.onLoad({ filter }, async args => {
if (!filterWith || args.filter.with === 'wgsl') {
const contents = await fs.readFile(args.path, 'utf8')
build.onLoad({ filter: /\.wgsl$/ }, async args => {
const contents = await fs.readFile(args.path, 'utf8')
return { contents, loader: 'text' }
}
return { contents, loader: 'text' }
})
}
})