Closed fsiddi closed 2 years ago
Hi @fsiddi! Thanks for for using this plugin and opening an issue, I guess it seems pretty similar to #18 . Please try the workaround described there and feel free to comment here if that won't work for you. Also, please consider smashing a ⭐if you've found this plugin useful to your purposes, thanks!
Thanks for the quick reply. Indeed adding the package to optimizeDeps.exclude
helped! As as side note, this means the package I am importing can't use the require
keyword for referencing *.glsl
paths, but should rather rely on import
.
Thank you, @fsiddi ! I'm glad that worked out well.
As as side note, this means the package I am importing can't use the
require
keyword for referencing*.glsl
paths, but should rather rely onimport
.
And also thanks for this note. I guess it's related to vite v3.0.0+
that switched to node:
imports so this plugin was adapted relatively to this strategy. I've mentioned it briefly in here.
After installing and configuring the plugin, I'm able to require .glsl files, as long as they are part of the application. However, when importing a package (installed in node_modules) which also requires a .glsl file I get an esbuild error:
I've been looking at Vite options, esbuild options and could not find a solution, yet. Is this behavior expected?
Edit: found this issue https://github.com/vitejs/vite/issues/1873 which seems related, but I don't fully understand the solution.