Skip to content

Instantly share code, notes, and snippets.

@fatihsolhan
Last active January 14, 2022 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatihsolhan/6cdbdaf3abdf815d36ea0449e7d0e250 to your computer and use it in GitHub Desktop.
Save fatihsolhan/6cdbdaf3abdf815d36ea0449e7d0e250 to your computer and use it in GitHub Desktop.
Module file for auto importing material design icons in Nuxt.js
import { resolve } from 'path'
const icons = ['Phone', 'Alarm']
export default function () {
this.nuxt.hook('components:dirs', (dirs) => {
dirs.push({
path: resolve('node_modules/vue-material-design-icons'),
prefix: 'MaterialIcon',
pattern: `**/@(${icons.join('|')}).vue`,
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment