nuxt-community/electron-template

add plugins

pucheta-adrian opened this issue · 1 comments

Hi,
how to add plugins in nuxt.config.js?
I am trying to add vuetify this.
like this

module.exports = {
  /*
  ** Electron Settings
  */
  electron: {
    width: 1024,
    height: 768
  },
  build: {
    vendor: ['vuetify'],
    plugins: ['~plugins/vuetify.js'],
    head: {
      link: [
        { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Roboto' },
        { rel: 'stylesheet', href: 'https://fonts.googleapis.com/icon?family=Material+Icons' }
      ]
    },
    extend (config, { isClient }) {
      // Extend only webpack config for client-bundle
      if (isClient) {
        config.target = 'electron-renderer'
      }
    }
  }
}
This question is available on Nuxt.js community (#c9)

@adrianrey05 Please see the Vue Plugins section of the Nuxt docs.

The plugins section of your nuxt.config.js should be beside the build section(that's for webpack settings), not inside of it. Also make sure you are importing and initializing vuetify in a file inside the plugins folder which needs to be next to your pages folder.