question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue while compiling .glsl files..

See original GitHub issue

I have GLSL shaders, not sure how to setup the webpack mix to compile the .glsl files…

This is the issue that I get on npm run watch: image

And this is how my webpack.mix.js looks like: `

    const mix = require('laravel-mix');

  /*
   |--------------------------------------------------------------------------
   | Mix Asset Management
   |--------------------------------------------------------------------------
   |
   | Mix provides a clean, fluent API for defining some Webpack build steps
   | for your Laravel application. By default, we are compiling the Sass
   | file for the application as well as bundling up all the JS files.
   |
   */
  
  mix.react('resources/js/app.js', 'public/js')
      .sass('resources/sass/bootstrap.scss', 'public/css')
          .less('resources/less/app.less', 'public/css'); 
           
  mix.webpackConfig({
      module: {
        rules: [
              {
              test: /\.(glsl|frag|vert)$/,
              loader: 'raw-loader',
              exclude: /node_modules/
              },
      
              {
              test: /\.(glsl|frag|vert)$/,
              loader: 'glslify-loader',
              exclude: /node_modules/
              }
          ]
      } 
     });

`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
thecrypticacecommented, Feb 11, 2021

Try this:

mix.webpackConfig({
  module: {
    rules: [
      {
        test: /\.(glsl|frag|vert)$/,
        exclude: /node_modules/,
        use: [
          'raw-loader',
          'glslify-loader',
        ],
      },
    ],
  },
})
0reactions
iwasherefirst2commented, May 23, 2022

Try this:

mix.webpackConfig({
  module: {
    rules: [
      {
        test: /\.(glsl|frag|vert)$/,
        exclude: /node_modules/,
        use: [
          'raw-loader',
          'glslify-loader',
        ],
      },
    ],
  },
})

Thank you! That worked for me 😃!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue while compiling .glsl files.. · Issue #2838 · laravel-mix ...
I have GLSL shaders, not sure how to setup the webpack mix to compile the .glsl files.. This is the issue that I...
Read more >
GLSL Shaders do not compile even if they have no obvious ...
Some programs do not use shader files. Instead they store the source code as const strings in the app source code. This way...
Read more >
Shader Compilation - OpenGL Wiki - Khronos Group
When the shader is compiled, it will be compiled as if all of the given strings were concatenated end-to-end. This makes it easy...
Read more >
GLSLC error when compiling shaders. : r/vulkan - Reddit
I'm planning on moving to the shaders being compiled at run time likely, at some later point, but for now my main issue...
Read more >
Shader modules - Vulkan Tutorial
A tutorial that teaches you everything it takes to render 3D graphics with the Vulkan API. It covers everything from Windows/Linux setup to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found