I'm currently utilizing esbuild to bundle my Typescript code, but I'm facing a challenge with configuring a loader for ".wgsl" files.
Here is my app.ts file:
import shader from './shader.wgsl';
//webgpu logic
This is my shader.d.ts file:
declare module '*.wgsl'{
const value: string;
export default value;
}
In my esbuild configuration file (unable to use ts-shader-loader):
import { build } from "esbuild";
import * as ShaderLoader from "ts-shader-loader";
build({
entryPoints: ['./src/app.ts'],
bundle: true,
sourcemap : true,
target : 'es2015',
format:'esm',
minify : true,
outfile: './dist/js/app.js',
tsconfig: './tsconfig.json'
plugins: [ShaderLoader]
}).catch(() => process.exit(1));