Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No loader is configured for ".glsl" in node_modules file #20

Closed
fsiddi opened this issue Sep 5, 2022 · 3 comments
Closed

No loader is configured for ".glsl" in node_modules file #20

fsiddi opened this issue Sep 5, 2022 · 3 comments
Assignees
Labels
duplicate Something was was pointed out before known issue Problem I'm aware of

Comments

@fsiddi
Copy link

fsiddi commented Sep 5, 2022

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:

'No loader is configured for ".glsl" files: node_modules/my-package/glsl/vertex.glsl'

I've been looking at Vite options, esbuild options and could not find a solution, yet. Is this behavior expected?

Edit: found this issue vitejs/vite#1873 which seems related, but I don't fully understand the solution.

@UstymUkhman
Copy link
Owner

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!

@UstymUkhman UstymUkhman self-assigned this Sep 5, 2022
@UstymUkhman UstymUkhman added needs clarification Waiting for more information known issue Problem I'm aware of labels Sep 5, 2022
@fsiddi
Copy link
Author

fsiddi commented Sep 5, 2022

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.

@fsiddi fsiddi closed this as completed Sep 5, 2022
@UstymUkhman
Copy link
Owner

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 on import.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Something was was pointed out before known issue Problem I'm aware of
Projects
None yet
Development

No branches or pull requests

2 participants