Skip to content

Commit f6397ea

Browse files
committed
fix: restore nuxt 3 support, closes #820
1 parent 27746ba commit f6397ea

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

packages/floating-vue/nuxt.mjs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export default function () {
2+
const nuxt = this.nuxt
3+
nuxt.options.vue.compilerOptions.directiveTransforms = nuxt.options.vue.compilerOptions.directiveTransforms || {}
4+
nuxt.options.vue.compilerOptions.directiveTransforms.tooltip = () => ({
5+
props: [],
6+
needRuntime: true,
7+
})
8+
9+
nuxt.options.css.push('floating-vue/dist/style.css')
10+
11+
this.addPlugin({
12+
filename: 'floating-vue.mjs',
13+
getContents: () => `
14+
import { defineNuxtPlugin } from '#app'
15+
import FloatingVue from 'floating-vue'
16+
17+
export default defineNuxtPlugin((nuxtApp) => {
18+
// @TODO cutomization
19+
nuxtApp.vueApp.use(FloatingVue)
20+
})
21+
`,
22+
})
23+
24+
// @TODO remove when floating-ui supports native ESM
25+
nuxt.options.build.transpile.push('floating-vue', '@floating-ui/core', '@floating-ui/dom')
26+
}

0 commit comments

Comments
 (0)