From e9c2cd9e959e9441e5d9619ca34553dd4e4d266f Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 26 Jun 2024 13:15:41 -0400 Subject: [PATCH] Serve map app at `/map/`, instead of manually enabling --- map/index.html | 12 ++++++++++++ src/index.js | 5 ----- src/map.js | 11 +++++++++++ vite.config.js | 9 +++++++++ 4 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 map/index.html create mode 100644 src/map.js diff --git a/map/index.html b/map/index.html new file mode 100644 index 0000000..ca3b8fa --- /dev/null +++ b/map/index.html @@ -0,0 +1,12 @@ + + + + + + APRS Map + + +
+ + + diff --git a/src/index.js b/src/index.js index c4ec222..9c83707 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,7 @@ import * as Vue from 'vue'; -// import OpenLayersMap from 'vue3-openlayers'; -// import 'vue3-openlayers/dist/vue3-openlayers.css'; - import StatusScreen from './StatusScreen.vue'; -// import Map from './Map.vue'; const app = Vue.createApp(StatusScreen); -// app.use(OpenLayersMap); app.mount('#app'); diff --git a/src/map.js b/src/map.js new file mode 100644 index 0000000..fa66d4f --- /dev/null +++ b/src/map.js @@ -0,0 +1,11 @@ +import * as Vue from 'vue'; + +import OpenLayersMap from 'vue3-openlayers'; +import 'vue3-openlayers/dist/vue3-openlayers.css'; + +import Map from './Map.vue'; + +const app = Vue.createApp(Map); +app.use(OpenLayersMap); + +app.mount('#app'); diff --git a/vite.config.js b/vite.config.js index beb59f7..98739f4 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,3 +1,4 @@ +import { resolve } from 'path'; import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; import yaml from '@rollup/plugin-yaml'; @@ -6,4 +7,12 @@ import yaml from '@rollup/plugin-yaml'; export default defineConfig({ assetsInclude: ['**/*.gpx'], plugins: [vue(), yaml()], + build: { + rollupOptions: { + input: { + main: resolve(__dirname, 'index.html'), + map: resolve(__dirname, 'map/index.html'), + }, + }, + }, });