Closed ryandurkoske closed 2 years ago
Hi @ryandurkoske , thanks for reporting this issue. Obviously I haven't consider multiple programs accessing the same shader chunk could cause a false recursion warning. This check seems to causing more problems that it's trying to solve. π
Anyway, I'll probably add a new config option when I get some more info related to issue #10 , it will look something like this:
import glsl from 'vite-plugin-glsl';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [glsl({ checkRecursiveImports: false })]
});
in order to prevent this check. What do you think, it might work for you? For now you can still use v0.1.2
since the only difference is this "recursive check", so everything else should work just the same.
P.S.: Thanks for using this plugin, I'm glad you've found it useful. Please consider giving a βto this project if that's a case. Thanks!
@ryandurkoske Starting from version 0.2.0
you are now able to disable this check with the following option:
import glsl from 'vite-plugin-glsl';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [glsl({ warnDuplicatedImports: false })]
});
Hope that helps to keep your console window clean, 'cause I'm also a fan of that. π Feel free to open a new issue if you notice some problem related (or not) to this check.
Cheers!
If you have two separate WebGL programs on you're site, and say programA.frag and programB.frag both include a utility function, the "Recursion detected" warning fires. Obviously, recursion would never be the first problem you would run into when trying to macro two separate shader programs together.
Checking to see if a file is included more than once is sufficient for this specific scenario, but it should be taken into account that their can be completely separate include trees.
Nothing breaks, but it is annoying for those that like a clean console window. Other than that, thanks for providing this tool! It works way better than any webpack solution I've used.