npm install wesl
If you are using a bundler, try the wesl plugin.
import { link } from "wesl";
const shaderCode = await link({
  weslSrc: {
    "main.wesl": mainWeslString,
    "fullscreen_quad.wesl": fullscreenQuadWeslString,
    "mandelbrot.wesl": mandelbrotWeslString,
  },
});
const shader = shaderCode.createShaderModule(device, {});
Check out the vanilla example