Socket
Socket
Sign inDemoInstall

vite-plugin-vuetify

Package Overview
Dependencies
312
Maintainers
7
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vite-plugin-vuetify

A Vite plugin for treeshaking Vuetify components and more


Version published
Weekly downloads
166K
increased by8.85%
Maintainers
7
Install size
271 kB
Created
Weekly downloads
 

Readme

Source

vite-plugin-vuetify

Become a Patron
Donate to OpenCollective

Automatic imports

// vite.config.js
plugins: [
  vue(),
  vuetify({ autoImport: true }), // Enabled by default
]
// plugins/vuetify.js
import 'vuetify/styles'
import { createVuetify } from 'vuetify'

export default createVuetify()

Style loading

Customising variables

// vite.config.js
plugins: [
  vue(),
  vuetify({ styles: { configFile: 'src/settings.scss' } }),
]
// plugins/vuetify.js
import 'vuetify/styles'
import { createVuetify } from 'vuetify'

export default createVuetify()
// settings.scss
@use 'vuetify/settings' with (
  $color-pack: false,
  $utilities: false,
);

settings.scss can be used in your own components to access vuetify's variables.

Customising variables (old method)

// vite.config.js
plugins: [
  vue(),
  vuetify({ styles: 'expose' }),
]
// plugins/vuetify.js
import './main.scss'
import { createVuetify } from 'vuetify'

export default createVuetify()
// main.scss
@use 'vuetify' with (
  $color-pack: false,
  $utilities: false,
);

Remove all style imports

// vite.config.js
plugins: [
  vue(),
  vuetify({ styles: 'none' }),
]
// plugins/vuetify.js
import { createVuetify } from 'vuetify'

export default createVuetify()

Import sass from source

Vuetify 3 uses precompiled css by default, these imports can optionally be modified to point to sass files instead:

// vite.config.js
plugins: [
  vue(),
  vuetify({ styles: 'sass' }),
]

Image loading

https://github.com/vitejs/vite/tree/main/packages/plugin-vue#asset-url-handling

// vite.config.js
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'

export default {
  plugins: [
    vue({ 
      template: { transformAssetUrls }
    }),
    vuetify(),
  ],
}

FAQs

Last updated on 13 Oct 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc