-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ESM file cannot be loaded by require
#56
Comments
@UstymUkhman, indeed that helped! 🎉 I resorted to making the export default defineConfig(async () => {
const glsl = (await import('vite-plugin-glsl')).default;
return {
plugins: [glsl()]
}
}); Thank you! 🙏🏼 Now I just need to figure out the following problem:
…caused by this import LabelColliderMaterialVertexShader from '/shaders/LabelColliderMaterial.vert'; Should I create a new issue for that? |
@asbjornu I believe with |
@UstymUkhman, sorry this was just me being silly. The application in question is made with Eleventy, and I had just forgotten to add Your plugin now seems to be working flawlessly. 🎉 Thank you for creating it, and for providing such swift and excellent support! 🙏🏼 |
Great @asbjornu! I'm glad it worked. Thanks for the kind words and for using this plugin, I appreciate it. Feel free to give it a ⭐if you've found it any useful, thanks! |
Similar to #1, I'm unable to load this plugin with Vite (version 5.2.13). With the following code:
…the following exception occurs when I run
vite build
:As you can see, I don't use
require()
to loadvite-plugin-glsl
. I don't have"type": "module"
inpackage.json
, because use Eleventy v2 which still isn't fully compatible with ESM (it will be in v3).I use other Vite plugins such as
@yushijinhun/three-minifier-rollup
andvite-plugin-compression
in the same project, and they work fine. Removing these problems does not help. Any idea whyvite-plugin-glsl
isn't loading?The text was updated successfully, but these errors were encountered: