davestewart / nuxt-content-assets

Enable locally-located assets in Nuxt Content
https://npmjs.com/package/nuxt-content-assets
108 stars 7 forks source link

Files with leading underscore `_` are not being picked up #59

Closed jvolker closed 7 months ago

jvolker commented 8 months ago

Description

Images/Files starting with and underscore character are not being picked up. If they are include the underscore they are not copied into .nuxt/content-assets/. In combination with Nuxt Image this leads to IPX Error: Error: File not found

To reproduce:

Add underscore to start of a file name and check .nuxt/content-assets/ Eg.:

davestewart commented 7 months ago

Hey Jeremias,

Sorry for the radio-silence the last few weeks, I've been working every waking hour on the release of Control Space! Anyway, it's done now so I have time to breath, and a little for OSS.

This is actually a Nuxt feature; any file with an underscore is deemed "hidden".

Can I find this in the Nuxt documentation for you now? Of course I can't! 😆

But this repo even has tests to ensure it adheres:

jvolker commented 7 months ago

Thanks so much for your response. And no worries. Of course, I totally understand that you have limited time for this.

I've been working every waking hour on the release of Control Space!

Love your tool! Looks awesome.

This is actually a Nuxt feature; any file with an underscore is deemed "hidden".

Can I find this in the Nuxt documentation for you now? Of course I can't! 😆

Thanks. That's interesting. I'm not super familiar with Nuxt yet, but I did find something underscore related on dynamic routes in the Nuxt 2 documentation: https://v2.nuxt.com/docs/features/file-system-routing/#dynamic-routes It seems like in Nuxt 3 this works differently though.

I don't rely on underscores in filenames, so it's not an issue for me anymore.

davestewart commented 7 months ago

Yeah, Nuxt 3 uses [id] whereas Nuxt 2 used _id :)