From 594aee61826f495041c5a8fa0c41383024b104ee Mon Sep 17 00:00:00 2001 From: Michael Roberts Date: Wed, 29 Dec 2021 13:44:01 +0000 Subject: [PATCH] [Bugfix] Potential hosted refs bug within the useObserver() composable. [Bugfix] Potential hosted refs bug within the useObserver() composable. Includes added rollupOptions in vite.lib.config.ts. --- src/composables/useObserver/index.ts | 6 +++--- vite.lib.config.ts | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/composables/useObserver/index.ts b/src/composables/useObserver/index.ts index 0d94129..d920eb8 100644 --- a/src/composables/useObserver/index.ts +++ b/src/composables/useObserver/index.ts @@ -26,9 +26,6 @@ export const validateLongitude = (longitude: number): boolean => { return (isFinite(longitude) && Math.abs(longitude) <= 180 && Math.abs(longitude) >= -180) || false } -// Obtain the querystring params of the url, if any: -const params = useUrlSearchParams('history') - export interface Observer { /** * @@ -72,6 +69,9 @@ export const useObserver = (options: UseObserverOptions) => { elevation: ele = defaultObserver.elevation } = options + // Obtain the querystring params of the url, if any: + const params = useUrlSearchParams('history') + // Reactive Geolocation API. It allows the user to provide their location // to web applications if they so desire. For privacy reasons, the user is // asked for permission to report location information. diff --git a/vite.lib.config.ts b/vite.lib.config.ts index ffea291..db8cb77 100644 --- a/vite.lib.config.ts +++ b/vite.lib.config.ts @@ -28,6 +28,17 @@ export default defineConfig({ entry: resolve(__dirname, 'src/index.ts'), name: 'useaestrium', fileName: format => `useaestrium.${format}.js` + }, + rollupOptions: { + external: ['vue', '@observerly/celestia'], + output: { + sourcemap: false, + // Provide global variables to use in the UMD build + // for externalized deps + globals: { + vue: 'Vue' + } + } } } }) \ No newline at end of file