davestewart / nuxt-content-assets

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

Feature: Automatically determine assets #2

Closed davestewart closed 1 year ago

davestewart commented 1 year ago

Background

Right now, the module relies on a list of asset extensions, so that only asset files are copied and ignored.

It might be better if we knew what file types were documents, so that anything else is deemed an asset by default.

Proposal

Potentially find out what transformers are registered and go from there.

Also, review Content's path meta rules, as these may play a part.

As a last resort, supply a string of defaults; could be just excludeExtensions ?

Notes

Transformers seem to be listed here:

Not sure if there is a way to get them outside of Content?

Potentially hook into content:context:

    nuxt.hook('content:context' as any, (config: any) => {
      console.log('content:context', { config })
    })

That is called in Content, here: