Skip to content

russmediadigital/theme-resolver

Repository files navigation

@russmedia/theme-resolver

npm version npm downloads CircleCI Codecov License

📖 Release Notes

Setup

  1. Add @russmedia/theme-resolver dependency to your project
npm install @russmedia/theme-resolver
  1. Use it in your Code
// define some options
const options = [
  {
    directories: [
      path.resolve(__dirname, 'src', 'theme1', 'components') // path to some theme directory,
      path.resolve(__dirname, 'src', 'theme2', 'components') // path to some different theme directory,
    ],
    prefix: '@components'
  },
]

// Create a new Instance
const instance = new ThemeResolver(options)

// Get correct resolver for a path
const path = '@components/test.vue'
const resolver = instance.getResolver(path)

// strip prefix from path
const filePath = instance.getFileName(path)

// resolveComponent
instance.resolveComponentPath(filePath, insance)

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Test code with npx jest

License

MIT License

Copyright (c) Julian Martin julian.martin@russmedia.com

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published