Open jdgjxxchy opened 1 year ago
In my tsconfig.json
I had
"compilerOptions": {
"types": ["naive-ui/volar"]
}
After removing it auto import works like a charm
nuxt.config.ts
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
export default defineNuxtConfig({
build: {
transpile:
process.env.NODE_ENV === 'production'
? [
'naive-ui',
'vueuc',
'@css-render/vue3-ssr',
'@juggle/resize-observer',
]
: ['@juggle/resize-observer'],
},
vite: {
plugins: [
Components({
resolvers: [NaiveUiResolver()],
}),
],
optimizeDeps: {
include:
process.env.NODE_ENV === 'development'
? ['naive-ui', 'vueuc', 'date-fns-tz/esm/formatInTimeZone']
: [],
},
},
})
I have tried several ways to add autoImport support for nuxt3 and all failed. Will it be possible to add autoImport support for nuxt3 in futrue? I'm tired in writing so many
import {} from 'naive-ui'
Did not work