-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nuxt 3 compatibility #475
Comments
Duplicate of #471 |
Meanwhile, this can help. |
Any news on this? Nuxt 3 RC was announced yesterday and Vuetify 3 will be available on May 2022. |
Yep would love to have some update on this! |
Here is how you can use Vuetify 3 with Nuxt 3 with automatic tree-shaking and imports using vite:
import { createVuetify } from 'vuetify'
export default defineNuxtPlugin((nuxtApp) => {
const vuetify = createVuetify({ ssr: process.server })
nuxtApp.vueApp.use(vuetify)
})
import type { NuxtModule } from '@nuxt/schema'
import vuetifyLoader from 'vite-plugin-vuetify'
// eslint-disable-next-line @typescript-eslint/require-await
const vuetifyModule: NuxtModule = async (_inlineOptions, nuxt) => {
nuxt.options.build.transpile.push('vuetify')
nuxt.options.css.push('vuetify/lib/styles/main.css')
nuxt.options.vite.ssr ??= {}
nuxt.options.vite.ssr.noExternal ??= []
if (!Array.isArray(nuxt.options.vite.ssr.noExternal)) {
throw new Error('Expected nuxt.options.vite.ssr.noExternal to be an array.')
}
nuxt.options.vite.ssr.noExternal.push('vuetify')
nuxt.hooks.hook('vite:extendConfig', (config) => {
config.plugins?.push(vuetifyLoader())
})
}
export default vuetifyModule
export default defineNuxtConfig({
// The rest of your config
modules: [
// Your other modules
'./modules/vuetify',
],
}) Now you can start using vuetify in your app, e.g.: <template>
<v-app>
<v-main>
<slot />
</v-main>
</v-app>
</template> pages/index.vue <template>
<v-container>
<v-card>
<v-card-title>Title</v-card-title>
<v-card-text>Text</v-card-text>
</v-card>
</v-container>
</template> |
Going to track here #522, thanks for the workarounds. If anyone is interested in helping migrate the module let us know :) |
Is your feature request related to a problem? Please describe.
Hi ! I have not currently found a solution to use vuetify 2 or 3 (alpha) with nuxt 3, do you have a roadmap so that we can follow the progress?
Describe the solution you'd like
.
Describe alternatives you've considered
.
Additional context
.
Thanks for your help !
The text was updated successfully, but these errors were encountered: