Closed emosheeep closed 1 year ago
@sodatea there is something needs to be reviewed, thanks!
maybe add an enum is enough
compositionAPI: 'auto' | 'native' | 'plugin' | 'vue-demi' | false
maybe add an enum is enough
compositionAPI: 'auto' | 'native' | 'plugin' | 'vue-demi' | false
of course, I just thought it might be more expansive. Does this commit can be merged after doing some modify?
I need this too, @sodatea any suggestion? it's very useful to library author
I made some changes, please review again, thanks!
I've encountered a situation that I need to make my lib compatible with both
vue 2.6
andvue2.7
at the same time, so I usedvue-demi
. I should ensure that all of imports from vue should be redirected tovue-demi
which makesvue-demi
work, but the plugin@vitejs/plugin-vue2-jsx
which used@vue/babel-preset-jsx
inside can't pass some options to control the import source. It will auto injectimport {h} from 'vue'
statements to the build result, which doesn't meet my needs. So I create this PR to extend the abilities of this plugin, wish I can pass{ compositionAPI: { importSource: 'vue-demi' } }
to the@vitejs/plugin-vue2-jsx
with usingvite
. Please take a code review, thanks!