vue项目中webpack编译glsl文件的配置
1、 安装webpack-glsl-loader
npm install webpack-glsl-loader
2、修改vue.config.js配置,添加内容如下
module.exports = defineConfig({
configureWebpack: (config) => {
config.module.rules.push({
test: /\.glsl$/,
use: [
{
loader: "webpack-glsl-loader",
},
],
});
},
})