Closed mrauhu closed 1 year ago
Can you give a reproduction link/repo?
@Zolyn, from https://github.com/nuxt/nuxt.js/issues/14645:
For every link:
npm test
.node_modules
directoryexport default defineNuxtConfig({
modules: [
'vite-plugin-vue-type-imports/nuxt',
],
});
modules/
directoryexport default defineNuxtConfig({
modules: [
'~/modules/vite-plugin-vue-type-imports.ts',
],
});
Also, example with defineNuxtModule()
:
I'm not familiar with Nuxt. I tried to build the plugin in the latest commit. Fortunately, the test passed. So it might have something to do with the version of tsup
.
It will be fixed in the next release.
By default, the vite-plugin-vue-type-imports/nuxt
module works in Nuxt 3. But, it doesn't work with test via Vitest and @nuxt/test-utils-edge
.
Hello, @wheatjs.
Found strange behavior: the
vite-plugin-vue-type-imports/nuxt
module is breaks the Vitest with@nuxt/test-utils-edge
package, but it's works if a same code is loaded frommodule/
directory:https://github.com/wheatjs/vite-plugin-vue-type-imports/blob/370fcea9c7a09a0961bdf6e29b0795963034eb1e/src/nuxt.ts#L3-L8
See: https://github.com/nuxt/nuxt.js/issues/14645
Maybe, also the Nuxt module is missing the
defineNuxtModule()
withsetup()
script, I rewrote it locally like this and the code is works:modules/vue-type-imports.ts
Best wishes, Sergey.