import Helper from '../helper.js'

export class Asset extends Helper {
  static isCacheable = true

  static dirname = __dirname
  
  static attach(host, options = {}) {
    return Helper.attach(host, Asset, {
      registryProp: 'assets',
      lookupProp: 'asset',
      registry: Helper.createContextRegistry('assets', {
        prefix: 'src/',
        context: require.context('.', false, /null/),
      }),
      ...options,
    })
  }

}

export const attach = Asset.attach

export default Asset
