privatenumber / vue-2-3

↔️ Interop Vue 2 components in Vue 3 apps and vice versa
MIT License
281 stars 10 forks source link

is Support vite? #2

Closed yoonasy closed 3 years ago

yoonasy commented 3 years ago

in vite

import xxx from 'moduleComponent'

Component

moduleComponent

import C1 from './inner/C1'
import C2 from './inner/C2'
import C3 from './inner/C3'

The component path needs to be add extension changed to import C1 from './inner/C1.vue'

It is currently reporting a path not found

privatenumber commented 3 years ago

I'm almost concerned you're just asking a Vite question here... but assuming you're trying to use Vue 2 components in Vite:

It should be possible if you're importing pre-built components (non-SFC) eg. from a component library.

SFCs in your Vite codebase won't work because Vite compiles them to Vue 3.

I'm not too familiar with how Vite works, but if it strictly uses rollup to build SFCs, maybe you can add the older rollup-plugin-vue plugin.