nvm fuck them kids
This commit is contained in:
parent
4f2d2e5863
commit
e1ab30a119
1 changed files with 4 additions and 7 deletions
11
src/index.js
11
src/index.js
|
@ -1,15 +1,12 @@
|
||||||
import fs from 'node:fs/promises'
|
import fs from 'node:fs/promises'
|
||||||
|
|
||||||
export const wgsl = ({ filterWith, filterExtension }) => ({
|
export const wgsl = () => ({
|
||||||
name: 'esbuild-plugin-wgsl',
|
name: 'esbuild-plugin-wgsl',
|
||||||
setup(build) {
|
setup(build) {
|
||||||
const filter = filterExtension || true ? /\.wgsl$/ : /.*/
|
build.onLoad({ filter: /\.wgsl$/ }, async args => {
|
||||||
build.onLoad({ filter }, async args => {
|
const contents = await fs.readFile(args.path, 'utf8')
|
||||||
if (!filterWith || args.filter.with === 'wgsl') {
|
|
||||||
const contents = await fs.readFile(args.path, 'utf8')
|
|
||||||
|
|
||||||
return { contents, loader: 'text' }
|
return { contents, loader: 'text' }
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue