vuejs / jsx-vue2

monorepo for Babel / Vue JSX related packages
https://jsx-vue2-playground.netlify.app/
1.47k stars 96 forks source link

feat: add importSource option #284

Closed sxzz closed 2 years ago

sxzz commented 2 years ago

Add an option importSource

In Vue 2.7, @vue/composition-api is no longer needed, it should be imported from vue.

emosheeep commented 1 year ago

Does this API(importSouce) can be exposed to users since I've encountered a situation that, I need to make my lib compatible with both vue 2.6 and vue2.7 at the same time, so I used vue-demi. I should ensure that all of imports from vue should be redirected to vue-demi, but the plugin @vitejs/plugin-vue2-jsx which used @babel/preset-vue-jsx inside can't pass some options to control the import source. It will auto inject import {h} from 'vue' statements to the build result.

sxzz commented 1 year ago

Maybe you can submit a PR for it.