initial commit
This commit is contained in:
commit
920f088ff8
2 changed files with 36 additions and 0 deletions
21
package.json
Normal file
21
package.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"name": "esbuild-plugin-wgsl",
|
||||
"version": "1.0.0",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": {
|
||||
"name": "Rowan",
|
||||
"email": "rowan@kitsu.cafe"
|
||||
},
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
"peerDependencies": {
|
||||
"esbuild": "0.x.x"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "0.x.x"
|
||||
}
|
||||
}
|
15
src/index.js
Normal file
15
src/index.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import fs from 'node:fs/promises'
|
||||
|
||||
export const wgsl = () => ({
|
||||
name: 'esbuild-plugin-wgsl',
|
||||
setup(build) {
|
||||
build.onLoad({ filter: /\.wgsl$/ }, async args => {
|
||||
const contents = await fs.readFile(args.path, 'utf8')
|
||||
|
||||
return { contents }
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
export default wgsl
|
||||
|
Loading…
Add table
Reference in a new issue