Importing asset as string
import positionVertex from "./position.vert.wgsl?raw";
npm install @loonguo/rollup-plugin-raw --save-dev
import raw from "@loonguo/rollup-plugin-raw";
rollup({
input: 'src/index.js',
plugins: [
raw({
include: "**/*.wgsl",
})
]
});
{
"compilerOptions": {
"types": [
"@loonguo/rollup-plugin-raw"
]
}
}