\r\nimport { defineConfig } from 'vite'\r\nimport vue from '@vitejs/plugin-vue'\r\nimport vueI18n from '@intlify/vite-plugin-vue-i18n'\r\n\r\n// https://vitejs.dev/config/\r\nconst path = require(\"path\")\r\nexport default defineConfig({\r\n test: {\r\n setupFiles: ['./tests/config.ts']\r\n },\r\n optimizeDeps: {\r\n exclude: ['vue-demi']\r\n },\r\n build: {\r\n lib: {\r\n entry: path.resolve(__dirname, 'src/install.ts'),\r\n name: 'vcp',\r\n formats: ['umd'],\r\n fileName: (format) => `vcp.${format}.ts`\r\n },\r\n rollupOptions: {\r\n external: ['vue', 'vueI18n', 'vue-demi',],\r\n output: {\r\n exports: 'named',\r\n globals: {\r\n 'vue-demi': 'VueDemi',\r\n 'vue': 'Vue',\r\n }\r\n }\r\n },\r\n },\r\n plugins: [\r\n vue({\r\n style: true,\r\n css: true\r\n }),\r\n vueI18n({\r\n include: path.resolve(__dirname, 'src/assets/translations.ts'),\r\n globalSFCScope: true,\r\n compositionOnly: false,\r\n }),\r\n ],\r\n server: {\r\n port: 8080\r\n },\r\n resolve: {\r\n dedupe: ['vue'],\r\n alias: {\r\n \"~\": path.resolve(__dirname, \"./src\"),\r\n \"@\": path.resolve(__dirname, \"./src\"),\r\n },\r\n },\r\n})\r\n\r\n```\r\n\r\npackage.json:\r\n```\r\n{\r\n \"name\": \"vcp\",\r\n \"version\": \"0.9.14\",\r\n \"private\": false,\r\n \"author\": \"Alireza Safari \u003Calireza.safaree@gmail.com> (http://alireza-safari.ir)\",\r\n \"license\": \"MIT\",\r\n \"main\": \"./dist/vcp.umd.ts\",\r\n \"description\": \"Vue Client Print with Template Builder\",\r\n \"exports\": {\r\n \".\": {\r\n \"require\": \"./dist/vcp.umd.ts\"\r\n },\r\n \"./dist/style.css\": \"./dist/style.css\"\r\n },\r\n \"keywords\": [\r\n \"vcp\",\r\n \"vue print\",\r\n \"vue client print\",\r\n \"template builder\",\r\n \"vue report\",\r\n \"vue report generator\"\r\n ],\r\n \"files\": [\r\n \"dist/*\"\r\n ],\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/alireza0sfr/vue-client-print\"\r\n },\r\n \"scripts\": {\r\n \"dev\": \"vite\",\r\n \"build\": \"vite build\",\r\n \"serve\": \"vite preview\",\r\n \"test\": \"vitest run --environment jsdom\",\r\n \"test:ui:\": \"vitest --environment jsdom --ui\",\r\n \"test:coverage\": \"vitest run --coverage --environment jsdom\",\r\n \"test:watch\": \"vitest --environment jsdom\"\r\n },\r\n \"dependencies\": {\r\n \"dom-to-image\": \"^2.6.0\",\r\n \"file-saver\": \"^2.0.5\",\r\n \"jsdom\": \"^19.0.0\",\r\n \"print-js\": \"^1.6.0\",\r\n \"register-service-worker\": \"^1.7.2\",\r\n \"typescript\": \"^4.7.2\",\r\n \"vitest\": \"^0.12.9\",\r\n \"vue-demi\": \"^0.12.5\",\r\n \"vue-i18n\": \"^9.1.10\"\r\n },\r\n \"peerDependencies\": {\r\n \"vue\": \">=2.0.0 || >=3.0.0\"\r\n },\r\n \"devDependencies\": {\r\n \"@intlify/vite-plugin-vue-i18n\": \"^3.4.0\",\r\n \"@vitejs/plugin-vue\": \"^2.3.3\",\r\n \"@vitest/ui\": \"^0.12.9\",\r\n \"@vue/compiler-sfc\": \"^3.2.36\",\r\n \"@vue/test-utils\": \"^2.0.0-rc.18\",\r\n \"c8\": \"^7.11.3\",\r\n \"cz-conventional-changelog\": \"^3.0.1\",\r\n \"vite\": \"^2.9.9\",\r\n \"vue\": \"^3.2.36\"\r\n }\r\n}\r\n\r\n```",[],161,"createElementVNode is not a function vite","2022-10-27T15:14:22Z","https://github.com/vueuse/vue-demi/issues/161",0.6933001,{"description":2905,"labels":2906,"number":2907,"owner":2853,"repository":2854,"state":2855,"title":2908,"updated_at":2909,"url":2910,"score":2911},"### First off \r\nThanks for all the amazing work! Super excited to be using Vue Demi. 🚀 \r\n\r\n----------------------------------\r\n\r\n### The Problem: \r\nThis is likely a user error, but I'm not able to find any examples of consuming a vue-demi plugin in a Nuxt 2 application to help point me in the right direction. \r\n\r\n**Here's what I have for my package.json in my vue-demi plugin:** \r\n```json\r\n \"peerDependencies\": {\r\n \"@vue/composition-api\": \"^1.4.5\",\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 \"dependencies\": {\r\n \"vue-demi\": \"^0.12.5\",\r\n },\r\n```\r\n\r\n```js\r\nmodule.exports = {\r\n chainWebpack: (config) => {\r\n config.externals(['@vue/composition-api', 'vue']);\r\n },\r\n};\r\n```\r\n--------------------------------\r\n\r\n**And in my consuming application:** \r\n```json\r\n\"dependencies\": {\r\n \"my-vue-demi-plugin\": \"1.0.0\",\r\n \"nuxt\": \"^2.15.2\",\r\n}\r\n```\r\n\r\n--------------------------------\r\n\r\nI'm getting the following error: \r\n\u003Cimg width=\"497\" alt=\"Screen Shot 2022-04-25 at 7 18 40 PM\" src=\"https://user-images.githubusercontent.com/2212763/165194784-1eb33040-08e7-467c-984f-ed369a03a61c.png\">\r\n\r\n--------------------------------\r\n\r\nUpon further inspection, I see that there's a `default` nested inside of external vue reference, which it seems that the install function isn't expecting. \r\n\r\n\u003Cimg width=\"862\" alt=\"Screen Shot 2022-04-25 at 7 11 52 PM\" src=\"https://user-images.githubusercontent.com/2212763/165194971-acef8f9e-5477-4207-8b5d-a71b60c2a502.png\">\r\n\u003Cimg width=\"966\" alt=\"Screen Shot 2022-04-25 at 7 20 01 PM\" src=\"https://user-images.githubusercontent.com/2212763/165194974-f535ed70-3560-412c-a2e8-8ac25b77b9da.png\">\r\n\r\n\r\nWhat am I missing here? 🤷 🤔 \r\n\r\n",[],155,"Nuxt 2 having issues with the lib_install function ","2022-04-27T14:10:36Z","https://github.com/vueuse/vue-demi/issues/155",0.69969106,{"description":2913,"labels":2914,"number":2915,"owner":2853,"repository":2854,"state":2916,"title":2917,"updated_at":2918,"url":2919,"score":2920},"Error: \"TypeError: Cannot read property 'observable' of undefined\"\r\n\r\n\r\nI try to create a component for Vue3/2 with (vue-demi + Vite2) .\r\nFirst, I'm focusing with Vue 2 setup, It's work fine in demo with directed import, but got error when in bundled lib (vite build)\r\n\r\n[https://github.com/sondh0127/vite-vue2-demi-reproduction/blob/d18773916b65c553c41c93b5823a4d797bcd0170/demo/App.vue#L11](https://github.com/sondh0127/vite-vue2-demi-reproduction/blob/d18773916b65c553c41c93b5823a4d797bcd0170/demo/App.vue#L11)\r\n\r\nPlease take a look. Here is my vite config.\r\n```ts\r\nimport { defineConfig } from 'vite'\r\nimport vue from '@vitejs/plugin-vue'\r\nimport { createVuePlugin } from 'vite-plugin-vue2'\r\nimport WindiCSS from 'vite-plugin-windicss'\r\nimport path from 'path'\r\n\r\n// https://vitejs.dev/config/\r\nexport default defineConfig({\r\n\tplugins: [\r\n\t\t// vue(),\r\n\t\tcreateVuePlugin({}),\r\n\t\t// WindiCSS(),\r\n\t],\r\n\tresolve: {\r\n\t\talias: {\r\n\t\t\t'@': `${path.resolve(__dirname, 'src')}`,\r\n\t\t},\r\n\t\tdedupe: ['vue-demi'],\r\n\t},\r\n\tbuild: {\r\n\t\tlib: {\r\n\t\t\tname: 'VueInteractive',\r\n\t\t\tentry: path.resolve(__dirname, 'src/main.ts'),\r\n\t\t},\r\n\t\tminify: false,\r\n\t\trollupOptions: {\r\n\t\t\texternal: ['vue'],\r\n\t\t\toutput: {\r\n\t\t\t\tglobals: {\r\n\t\t\t\t\tvue: 'Vue',\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t},\r\n\t},\r\n\r\n\toptimizeDeps: {\r\n\t\texclude: ['vue-demi'],\r\n\t},\r\n})\r\n```\r\n\r\n\r\nReproduction: [https://github.com/sondh0127/vite-vue2-demi-reproduction](https://github.com/sondh0127/vite-vue2-demi-reproduction)\r\n",[],69,"closed","Vue instance got 'undefined' in build with Vite + library mode","2021-07-09T17:08:21Z","https://github.com/vueuse/vue-demi/issues/69",0.6537326,{"description":2922,"labels":2923,"number":2924,"owner":2853,"repository":2853,"state":2916,"title":2925,"updated_at":2926,"url":2927,"score":2928},"I'm running into typescript errors when trying to build a project using vite and vue-tsc (Vue 3 with typescript).\r\n\r\nThese are the errors that I get:\r\n\r\n\r\n\r\nWhen running the project in dev mode, it builds successfully.\r\n\r\nDid anyone else experience anything similar? ",[],829,"Errors building with \"vue-tsc --noEmit && vite build\"","2021-10-07T13:58:09Z","https://github.com/vueuse/vueuse/issues/829",0.6746243,{"description":2930,"labels":2931,"number":2932,"owner":2853,"repository":2854,"state":2916,"title":2933,"updated_at":2934,"url":2935,"score":2936},"I'm trying to set up a component library with vue-demi (Vite + Vue 3 + Setup Script). Importing thing work fine in Vue 3 apps, but fail for Vue 2. The resulting bundle looks like this:\r\n\r\nBaseButton.vue to be imported by Vue2/3 App\r\n```vue\r\n\u003Cscript setup lang=\"ts\">\r\nimport { ref } from \"vue-demi\";\r\n\r\ndefineProps({\r\n label: {\r\n type: String,\r\n default: \"\",\r\n },\r\n});\r\n\r\nconst counter = ref(0);\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003Clabel>\r\n {{ label }}\r\n {{ counter }}\r\n \u003Cbutton v-bind=\"$attrs\" @click=\"counter++\">\r\n \u003Cslot />\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.6816228,["Reactive",2938],{},["Set"],["ShallowReactive",2941],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$finPrimngW_qck-ZvbwxL_9nWlGAu_gamRiFUs0xFm0I":-1},"/vueuse/vue-demi/212"]