Replies: 6 comments 5 replies
-
See the docs for Vite SSG for more details. |
Beta Was this translation helpful? Give feedback.
-
Thank you. For information, this is how to add Vuetify 3. // modules/vuetify.js
// /src/main.ts
|
Beta Was this translation helpful? Give feedback.
-
@frck006 : I have tried the same, but it seems that I adding vuetify 3 fails: Have you also changed the Do you maybe havea working example? |
Beta Was this translation helpful? Give feedback.
-
@peterbud I got mine working by creating a custom version of VuetifyResolver to change the import path from src/plugins/vuetifyResolver.ts /**
* Custom vite-plugin-components resolver for Vuetify v3
* Solves https://github.com/antfu/vitesse/discussions/174
*
* @link https://github.com/vuetifyjs/vuetify
*/
export function VuetifyResolver(): any {
return (name: string) => {
if (name.match(/^V[A-Z]/))
return { importName: name, path: 'vuetify' }
}
} vite.config.ts import { VuetifyResolver } from './src/plugins/vuetifyResolver'
export default defineConfig({
plugins: [
// https://github.com/antfu/vite-plugin-components
ViteComponents({
customComponentResolvers: [
// https://github.com/vuetifyjs/vuetify/
VuetifyResolver(),
],
}),
],
}) src/modules/vuetify.ts import '@mdi/font/css/materialdesignicons.css'
import { createVuetify } from 'vuetify'
// import * as components from 'vuetify/lib/components'
import * as directives from 'vuetify/lib/directives'
import 'vuetify/lib/styles/main.sass'
import { UserModule } from '~/types'
// https://github.com/vuetifyjs/vuetify/
export const install: UserModule = ({ app }) => {
const vuetify = createVuetify({
// Components will be imported by vite-plugin-components
// components,
directives,
})
app.use(vuetify)
} This should probably be turned into a pull request similar to unplugin/unplugin-vue-components#32 |
Beta Was this translation helpful? Give feedback.
-
@athisun use To integrate with this template the best way to do it is installing the new "devDependencies": {
"@vuetify/vite-plugin": "^1.0.0-alpha.2",
<other-deps>
} // vite.config.ts
import Vuetify from '@vuetify/vite-plugin'
plugins: [
Vuetify({ styles: 'expose' }),
] // src/modules/i18n.ts
import { createVuetify, VuetifyOptions } from 'vuetify'
export const install: UserModule = ({ app }) => {
const i18n = createI18n({
legacy: false,
locale: 'en',
messages,
})
const options: VuetifyOptions = {
locale: createVueI18nAdapter({
i18n,
useI18n,
}),
}
const { install } = createVuetify(options)
app.use(i18n)
app.use(install)
} For // src/modules/i18n.ts
import { createVuetify, VuetifyOptions } from 'vuetify'
import { aliases, mdi } from 'vuetify/iconsets/mdi-svg'
export const install: UserModule = ({ app }) => {
const i18n = createI18n({
legacy: false,
locale: 'en',
messages,
})
const options: VuetifyOptions = {
locale: createVueI18nAdapter({
i18n,
useI18n,
}),
icons: {
defaultSet: 'mdi',
aliases,
sets: {
mdi,
},
},
}
const { install } = createVuetify(options)
app.use(i18n)
app.use(install)
} |
Beta Was this translation helpful? Give feedback.
-
Hello everybody, I just start to use this Vitesse template to migrate my existing VueJs app. In this app I use Vuetify, and I have some trouble to install Vuetify in Vitesse template. I'm not sure to understand the steps to installe the vuetify vit plugin. Maybe, I miss some steps, because I had errors during install. Thanks, and have a nice day. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I would like to use Vuetify instead of tailwind.
Until now Vuetify was not compliance with Vue3, but now, there is Vuetify 3 Alpha.
Normaly, we can use it with vue-cli 4 and add
How can I do this with ViteSSG ?
Regards,
Franck
Beta Was this translation helpful? Give feedback.
All reactions