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

Error compiling glslify file with relative module imports #35

Closed
franjaviersans opened this issue Oct 8, 2021 · 5 comments
Closed

Error compiling glslify file with relative module imports #35

franjaviersans opened this issue Oct 8, 2021 · 5 comments
Assignees

Comments

@franjaviersans
Copy link

I have a relative import in my files like this:

#pragma glslify: someModule = require("../../shaders/utils/someModule.glsl")

And the extension fails to compile like this:

GLSL Lint: GLSL Lint: failed to compile the glslify file! Error: Cannot find module

As it is using only the basedir indicated as an option or the working directory path.

Is it possible to set an option to solve the import relative to the current file directory?

@hsimpson hsimpson self-assigned this Oct 8, 2021
@hsimpson
Copy link
Owner

hsimpson commented Oct 8, 2021

Should not be a complex thing to implement, I will check this.

@hsimpson
Copy link
Owner

hsimpson commented Oct 9, 2021

@franjaviersans I have created a 1.5.0 release to add a feature you can set glslifyUseCurrentFileAsBasedir to true.
Could you please try this on your side?

@franjaviersans
Copy link
Author

@hsimpson yes, it does work perfectly. Thank you!

@hsimpson
Copy link
Owner

hsimpson commented Oct 9, 2021

@hsimpson yes, it does work perfectly. Thank you!

Nice, then I will officially release this version.

@hsimpson
Copy link
Owner

hsimpson commented Jan 6, 2022

@franjaviersans oh thanks for closing 👍
I have forgot this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants