报错内容如下

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

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐