From de2612da271fadc434e4cf3bdfdf68666eb1b7ee Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 24 Feb 2023 19:01:47 +0800 Subject: [PATCH] fix: pages using tanstack query cannot be loaded in production build (#889) --- package.json | 1 + pnpm-lock.yaml | 2 ++ src/build/library-external.ts | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/package.json b/package.json index 917852a7..0ef6b577 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "qs": "^6.11.0", "transliteration": "^2.3.5", "vue": "^3.2.45", + "vue-demi": "^0.13.11", "vue-grid-layout": "3.0.0-beta1", "vue-i18n": "^9.2.2", "vue-router": "^4.1.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99a48ce5..0cc35d34 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -98,6 +98,7 @@ importers: vite-plugin-static-copy: ^0.11.1 vitest: ^0.25.3 vue: ^3.2.45 + vue-demi: ^0.13.11 vue-grid-layout: 3.0.0-beta1 vue-i18n: ^9.2.2 vue-router: ^4.1.6 @@ -149,6 +150,7 @@ importers: qs: 6.11.0 transliteration: 2.3.5 vue: 3.2.45 + vue-demi: 0.13.11_vue@3.2.45 vue-grid-layout: 3.0.0-beta1_farzh4kmmmdsqeu7trbjloi3zi vue-i18n: 9.2.2_vue@3.2.45 vue-router: 4.1.6_vue@3.2.45 diff --git a/src/build/library-external.ts b/src/build/library-external.ts index 69076ead..6c388736 100644 --- a/src/build/library-external.ts +++ b/src/build/library-external.ts @@ -37,6 +37,11 @@ export const setupLibraryExternal = ( dest: "assets/vue-router", rename: `vue-router.global.${staticSuffix}.js`, }, + { + src: `./node_modules/vue-demi/lib/index.iife.js`, + dest: "assets/vue-demi", + rename: `vue-demi.${staticSuffix}.js`, + }, { src: "./node_modules/@vueuse/shared/index.iife.min.js", dest: "assets/vueuse", @@ -88,6 +93,7 @@ export const setupLibraryExternal = ( "@vueuse/core": "VueUse", "@vueuse/components": "VueUse", "@vueuse/router": "VueUse", + "vue-demi": "VueDemi", }), ViteStaticCopy({ targets: staticTargets,