\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.7051767,{"description":2884,"labels":2885,"number":2886,"owner":2868,"repository":2869,"state":2870,"title":2887,"updated_at":2888,"url":2889,"score":2890},"First of all, I saw a couple of issues that involved more or less the same issue, but I tought it would be useful to group everything into one issue, so we could hopefully try to solve it.\r\n\r\n### Related issues:\r\n\r\n- #145 \r\n- #136 \r\n- #117 \r\n- #129 \r\n\r\n### Problem\r\n\r\nI'm currently building a private reusable package for a real-world application. This application runs on `nuxt2` (currently `nuxt-bridge`), and we're planning to migrate to `nuxt3` when all the packages we need are there. The idea was to build that reusable package in `vue3`, and use `vue-demi` to make it possible to be used in our `nuxt-bridge` app.\r\n\r\nAt first I just tried building the library and use it in a separate vue 3 app. With Vite it was really fast & easy to make it work 🎉\r\n\r\nHowever when I tried importing it in our `nuxt-bridge` app I came across several issues:\r\n\r\n1) When externalising `vue` dependency in vite, I got a list of warnings that some functions are not exported by vue. This is what the most issues are about.\r\n\r\n2) When I don't externalise `vue` in `vite.config.js`, I just get an empty component. In my repro I don't get any warning. I just see an anonymous component in my dev tools. In my production nuxt-app, I see the following error: `no template or render function is defined`. The component seemed to be imported correctly, it just doesn't render any HTML.\r\n\r\n3) I saw in other issues that the solution might be to externalise `vue-demi` as well, but that doesn't seem to make any difference for this.\r\n\r\n4) also tried using `npx vue-demi-fix` && `npx vue-demi-switch 2` commands, but these also doesn't seem to be changing a whole lot.\r\n\r\nI also saw that in #117 , [@koooge](https://github.com/koooge) researched into the issue a bit and saw that it might be due to a breaking change in @vue/core.\r\n\r\nThat's when I decided to build a repro with a vue2 app (@vue/cli), vue3 app (vite) and a simple component in a separate lib.\r\n\r\n### Repro\r\n\r\nhttps://github.com/jclaessens97/vue-demi-vue2-broken-repro\r\n\r\n\r\nI hope we can look into this issue and try to come up with a solution to be able to make vue3 components compatible for vue2, until everything is vue3 ready.\r\n",[],152,"Vue3 lib not working in Vue2 projects","2022-10-14T07:02:51Z","https://github.com/vueuse/vue-demi/issues/152",0.70717067,{"description":2892,"labels":2893,"number":2894,"owner":2868,"repository":2869,"state":2870,"title":2895,"updated_at":2896,"url":2897,"score":2898},"【description】:\r\nI want to try create the same component for Vue2 & Vue3 in the same source code, so I find vue-demi. But.. I have seen some projects likes [json-editor-vue](https://github.com/cloydlau/json-editor-vue). For compact Vue2 & Vue3, I found its source code write `render` options for 2 & 3. But i think it's hard for developer to code.\r\n\r\n I prefer to code in `template` in a sfc file. So i have some idea(We can smooth the difference with `Vue2` & `Vue3` when we compile components). Can we write a component with `setup` & `composition-api` in a `sfc`. And then when we compile the component, we can use a series of plugins for `Vue2`: `unplugin-auto-import`, `unplugin-vue2-script-setup`, `vite-plugin-vue2`, `vue-template-compiler@2.6.x`, and plugins for `Vue3`: `@vitejs/plugin-vue`. \r\n\r\n@antfu Maybe u have thought some idea before create this repo. So can u give me some advice or info?",[],153,"it's hard for developer to write a common component with vue-demi ","2023-01-30T23:22:27Z","https://github.com/vueuse/vue-demi/issues/153",0.7085513,{"description":2900,"labels":2901,"number":1992,"owner":2868,"repository":2869,"state":2902,"title":2903,"updated_at":2904,"url":2905,"score":2906},"vuelidate is using vue-demi to help them with their new version support both Vue 2 and Vue 3. They need access to the equivalent of the Plugin. This is a new type in Vue 3 and should have an equivalent in Vue 2. \r\n\r\nIs there a way that Vue-demi could provide a common abstraction? \r\nHere is the open in issue on vuelidate\r\nhttps://github.com/vuelidate/vuelidate/issues/767\r\n",[],"closed","vue-demi doesn't include Plugin export","2021-07-15T17:17:11Z","https://github.com/vueuse/vue-demi/issues/32",0.68034977,{"description":2908,"labels":2909,"number":2913,"owner":2868,"repository":2869,"state":2902,"title":2914,"updated_at":2915,"url":2916,"score":2917},"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",[2910],{"name":2911,"color":2912},"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.6902051,{"description":2919,"labels":2920,"number":2921,"owner":2868,"repository":2869,"state":2902,"title":2922,"updated_at":2923,"url":2924,"score":2925},"Hi there,\r\n\r\nI'm struggling to make a lib with @vue/cli and stuck because @vue/cli looks like a minor choice for vue-demi.\r\n\r\nvue.config.js:\r\n\r\n```vue.config.js\r\nmodule.exports = {\r\n configureWebpack: {\r\n externals: {\r\n 'vue-demi': 'vue-demi',\r\n },\r\n },\r\n};\r\n```\r\n\r\nuser outputs the error (vue 2.6.14):\r\n```\r\nTypeError: (0 , external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode) is not a function\r\n```\r\n\r\nIt does not seem that there is such a method createElementVNode in Vue2. Is this an issue only with @vue/cli?\r\n\r\nenv: vue-demi 0.12.1, vue 3.2.22, @vue/cli 5.0.0-rc.0",[],117,"createElementVNode is not a function with @vue/cli","2022-09-04T15:46:39Z","https://github.com/vueuse/vue-demi/issues/117",0.69077796,{"description":2927,"labels":2928,"number":2929,"owner":2868,"repository":2868,"state":2902,"title":2930,"updated_at":2931,"url":2932,"score":2933},"In vue 3.2.10+, vue-compat is built in default exports mode instead of named mode. As a result, there are complie errors such as \"in ./node_modules/@vueuse/core/index.mjs: Can't import the named export 'bypassFilter/tryOnUnmounted/unref/etc..' from non EcmaScript module (only default export is available)\".\r\nI'm not sure this is vueuse's issue cause my project depends on a lot of package except vueuse. After upgrading vue from 3.2.9 to 3.2.10+, these errors occurred. When I checked yarn.lock, I found that element-plus depends on @vueuse/core@6.2.0. So I try to post this issue here to look for further help. Wishes~",[],750,"Maybe vueuse's issue when compiling with Vue 3.2.10+","2021-09-15T11:47:46Z","https://github.com/vueuse/vueuse/issues/750",0.6940715,{"description":2935,"labels":2936,"number":2937,"owner":2868,"repository":2869,"state":2902,"title":2938,"updated_at":2939,"url":2940,"score":2941},"https://cdn.skypack.dev/-/vue-demi@v0.11.0-TmCmtDOAoOKuMLLEdJI0/dist=es2020,mode=imports/optimized/vue-demi.js\r\n\r\n```js\r\nexport * from \"/-/vue@v2.6.14-ZwqBV9vu181DzQDewEXR/dist=es2020,mode=imports/optimized/vue.js\";\r\nimport * as vue from \"/-/vue@v2.6.14-ZwqBV9vu181DzQDewEXR/dist=es2020,mode=imports/optimized/vue.js\";\r\nexport {vue as Vue};\r\nvar isVue2 = false;\r\nvar isVue3 = true;\r\n```",[],72,"Skypack version of vue-demi imports vue 2 but sets isVue3 to true","2021-07-15T20:01:06Z","https://github.com/vueuse/vue-demi/issues/72",0.6946985,{"description":2943,"labels":2944,"number":2945,"owner":2868,"repository":2869,"state":2902,"title":2946,"updated_at":2947,"url":2948,"score":2949},"Hi :) Trying `vue-demi` (as a dependency of `vue-global-api`) on latest nuxt3 version, production build fails since there is no `import` matcher. (and currently [node condition](https://github.com/vueuse/vue-demi/blob/master/package.json#L16) is set to cjs)\r\n\r\n> Could not resolve import \"vue-demi\" in ..../node_modules/vue-global-api/onActivated.mjs using exports defined in ..../node_modules/vue-demi/package.json\r\n\r\nIt can be fixed by adding `import` field to package.json: (should be ideally esm build)\r\n\r\n```diff\r\n \"exports\": {\r\n \".\": {\r\n \"require\": \"./lib/index.cjs.js\",\r\n++ \"import\": \"./lib/index.cjs.js\",\r\n \"node\": \"./lib/index.cjs.js\",\r\n \"browser\": \"./lib/index.esm.js\"\r\n },\r\n \"./*\": \"./*\"\r\n },\r\n```\r\n\r\n- Note: I think it would be much better if you tend to use explicit `.mjs` and `.cjs` extensions so that tooling can infer module type.\r\n- Note: SSR vs Node: `node` condition can be added to niro resolver but since there are also non Node.js SSR environments (like Cloudflare workers) we would need import only support",[],71,"Node.js ESM export support","2021-07-15T16:34:45Z","https://github.com/vueuse/vue-demi/issues/71",0.6962242,["Reactive",2951],{},["Set"],["ShallowReactive",2954],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fqD3LWN_OSKQIpHGiguzxKNdlbZMjK93MjeOXsHFMzpQ":-1},"/vueuse/vue-demi/41"]