\r\n \u003C/button>\r\n \u003C/label>\r\n\u003C/template>\r\n```\r\n\r\nBuild output:\r\n```js\r\nimport { defineComponent, ref, openBlock, createElementBlock, createTextVNode, toDisplayString, createElementVNode, mergeProps, renderSlot } from \"vue\";\r\nconst _sfc_main = /* @__PURE__ */ defineComponent({\r\n props: {\r\n label: {\r\n type: String,\r\n default: \"\"\r\n }\r\n },\r\n setup(__props) {\r\n const counter = ref(0);\r\n return (_ctx, _cache) => {\r\n return openBlock(), createElementBlock(\"label\", null, [\r\n createTextVNode(toDisplayString(__props.label) + \" \" + toDisplayString(counter.value) + \" \", 1),\r\n createElementVNode(\"button\", mergeProps(_ctx.$attrs, {\r\n onClick: _cache[0] || (_cache[0] = ($event) => counter.value++)\r\n }), [\r\n renderSlot(_ctx.$slots, \"default\")\r\n ], 16)\r\n ]);\r\n };\r\n }\r\n});\r\nexport { _sfc_main as BaseButton };\r\n```\r\n\r\nIn Vue 2 I run into `Uncaught TypeError: Object(...) is not a function` error with `defineComponent()`. I suppose it should be importing from \"vue-demi\" instead of \"vue\"?\r\n\r\nPackage.json\r\n```json\r\n\"dependencies\": {\r\n \"vue-demi\": \"^0.12.4\"\r\n },\r\n \"devDependencies\": {\r\n \"@types/node\": \"^17.0.21\",\r\n \"@vitejs/plugin-vue\": \"^2.2.0\",\r\n \"@vue/composition-api\": \"^1.4.9\",\r\n \"typescript\": \"^4.5.4\",\r\n \"vite\": \"^2.8.0\",\r\n \"vue\": \"^3.2.25\",\r\n \"vue-tsc\": \"^0.29.8\"\r\n },\r\n \"peerDependencies\": {\r\n \"@vue/composition-api\": \"^1.0.0-rc.1\",\r\n \"vue\": \"^2.0.0 || >=3.0.0\"\r\n },\r\n \"peerDependenciesMeta\": {\r\n \"@vue/composition-api\": {\r\n \"optional\": true\r\n }\r\n },\r\n```\r\n\r\nvite.config.ts\r\n```ts\r\nexport default defineConfig({\r\n plugins: [vue()],\r\n build: {\r\n lib: {\r\n entry: path.resolve(__dirname, \"src/lib.ts\"),\r\n name: \"myLib\",\r\n fileName: (format) => `lib.${format}.js`,\r\n },\r\n rollupOptions: {\r\n // make sure to externalize deps that shouldn't be bundled\r\n // into your library\r\n external: [\"vue\"],\r\n output: {\r\n // Provide global variables to use in the UMD build\r\n // for externalized deps\r\n globals: {\r\n vue: \"Vue\",\r\n },\r\n },\r\n },\r\n },\r\n optimizeDeps: {\r\n exclude: [\"vue-demi\"],\r\n },\r\n});\r\n```",[],145,"Not running on Vue 2 App","2022-09-04T15:48:05Z","https://github.com/vueuse/vue-demi/issues/145",0.7010332,{"description":2933,"labels":2934,"number":2935,"owner":2868,"repository":2869,"state":2887,"title":2936,"updated_at":2937,"url":2938,"score":2939},"Imports of `resolveDirective`, `withDirectives` and many other vue@3 modules are not found in `vue-demi` when used in vue@2 environments.\r\n\r\n```js\r\nimport {\r\n defineComponent,\r\n h,\r\n isVue2,\r\n resolveComponent,\r\n resolveDirective,\r\n withDirectives,\r\n vModelDynamic,\r\n vShow,\r\n} from 'vue-demi';\r\n```\r\n\r\nIn vue@2 environments this will result in an error like `\"export 'withDirectives' was not found in 'vue-demi'`.\r\n\r\nAny idea on how to handle these cases?",[],60,"resolveDirective, withDirectives and many other vue@3 modules are not found in vue-demi when used in vue@2 environments","2021-07-15T17:20:01Z","https://github.com/vueuse/vue-demi/issues/60",0.70438534,{"description":2941,"labels":2942,"number":2946,"owner":2868,"repository":2869,"state":2887,"title":2947,"updated_at":2948,"url":2949,"score":2950},"It seems somehow vue2 is not resolved in vue-demi.\r\n###Env:###\r\nI make the lib dependency same as readme recommended.\r\nAnd the project using the lib is in vue 3.0.0.\r\nhere is the library package.json:\r\n\r\n\r\n ###Error:###\r\n error in ../tools/gei-framework/node_modules/vue-demi/lib/index.mjs\r\n\r\n\"export 'default' (reexported as 'Vue') was not found in 'vue'.\r\n\r\n\r\n\r\n",[2943],{"name":2944,"color":2945},"needs reproduction","fcd735",97,"export default was not found in 'vue'.","2021-09-01T02:08:40Z","https://github.com/vueuse/vue-demi/issues/97",0.7071087,["Reactive",2952],{},["Set"],["ShallowReactive",2955],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fCjxJCQWudnXTYLiRVEfyWC0TsJ3wEge-TPbQAOkJql4":-1},"/vueuse/vue-demi/72"]