-
Notifications
You must be signed in to change notification settings - Fork 338
/
nuxt.mjs
30 lines (24 loc) · 956 Bytes
/
nuxt.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export default async function (_, _nuxt) {
const { addPluginTemplate } = await import('@nuxt/kit')
const nuxt = (this && this.nuxt) || _nuxt
nuxt.options.css.push('floating-vue/dist/style.css')
addPluginTemplate({
filename: 'floating-vue.mjs',
getContents: () => `
import { defineNuxtPlugin } from '#imports'
import FloatingVue from 'floating-vue'
export default defineNuxtPlugin((nuxtApp) => {
// @TODO cutomization
nuxtApp.vueApp.use(FloatingVue)
})
`,
})
// @TODO remove when floating-ui supports native ESM
nuxt.options.build.transpile.push('floating-vue', '@floating-ui/core', '@floating-ui/dom')
// SSR support for v-tooltip directive
nuxt.options.vue.compilerOptions.directiveTransforms = nuxt.options.vue.compilerOptions.directiveTransforms || {}
nuxt.options.vue.compilerOptions.directiveTransforms.tooltip = () => ({
props: [],
needRuntime: true,
})
}