Vuetify-module: Unable to set defaultAssets to false to stop automatic loading of materialdesignicons.min.css and Robotto font.

Created on 31 Aug 2020  路  3Comments  路  Source: nuxt-community/vuetify-module

Module version
"1.11.2"

Describe the bug
I am unable to set the config file to exclude materialdesignicons being loaded automatically. I installed @mdi/js and am importing my icons like this import { mdiHome } from '@mdi/js'

According to your documentation, I can switch the automatic loading of materialdesignicons and font off by setting defaultAssets to false. This however does not work.

I have also tried the following :
defaultAssets: { font: false, icons:false }

To Reproduce
Here is my full Vuetifyjs config

vuetify: { customVariables: ['~/assets/variables.scss'], theme: { dark: false, themes: { dark: { primary: '#757575', secondary: '#424242', accent: '#82B1FF', error: '#FF5252', info: '#2196F3', success: '#4CAF50', warning: '#FFC107', }, light: { primary: '#757575', secondary: '#424242', accent: '#82B1FF', error: '#FF5252', info: '#2196F3', success: '#4CAF50', warning: '#FFC107', }, }, treeShake: true, defaultAssets: false, }, },

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
When I check the network traffic, materialdesignicons.min.css and roboto font should not be loaded.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Most helpful comment

This worked for me, I think there might be a difference if you pass the options inside the import or outside.

['@nuxtjs/vuetify', {
      optionsPath: '~/assets/scss/vuetify-options.js',
      customVariables: ['~/assets/scss/vuetify-theme.scss'],  
      defaultAssets: {
        font: false,
        icons: false,
      },
      lang: {current: 'de'},
      treeShake: true,
    }],

All 3 comments

Your documentation states that :
You can also set the whole defaultAssets option to false to prevent any automatic add of these two assets. You can read more about adding your own assets in the Offline applications section.

This worked for me, I think there might be a difference if you pass the options inside the import or outside.

['@nuxtjs/vuetify', {
      optionsPath: '~/assets/scss/vuetify-options.js',
      customVariables: ['~/assets/scss/vuetify-theme.scss'],  
      defaultAssets: {
        font: false,
        icons: false,
      },
      lang: {current: 'de'},
      treeShake: true,
    }],

I ran into the same issue, but different steps to reproduce. For me the bug occurs when treeShake is false, setting it to true meant I could set a different font correctly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lobo-tuerto picture lobo-tuerto  路  7Comments

Ghalnas picture Ghalnas  路  4Comments

1000snowy picture 1000snowy  路  3Comments

stact picture stact  路  3Comments

filipwronski picture filipwronski  路  7Comments