admin管理员组

文章数量:1530517

报错内容如下

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.

最近跟着学了下three的着色器,编写的GLSL文件,编译的时候报错,看意思可能是缺少loader,苦于不知道是那个loader,一番百度查询到的,在此记录一下
1、 npm install --save-dev webpack-glsl-loader 安装webpack-glsl-loader
2、修改vue.config.js配置,添加内容如下

  configureWebpack: (config) => {
    config.module.rules.push({
      test: /\.glsl$/,

      use: [
        {
          loader: "webpack-glsl-loader",
        },
      ],
    });
  },

3、重新npm run serve

本文标签: 文件项目glslwebpackvue