From 230b65b65ad51d8adaef81760ae3f8b2ac49fcde Mon Sep 17 00:00:00 2001 From: "Daniel W. Steinbrook" Date: Sun, 30 Jun 2024 10:06:22 -0400 Subject: [PATCH] Use relative paths for assets during build --- README.md | 10 +++++----- vite.config.ts | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b01b2d9..63eb92d 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,12 @@ To use a location other than what's reported by your device, include the latitud ``` npm ci && npm run build && npm run serve-tiles ``` + The app should now be running and accessible over HTTP from a web browser at http://127.0.0.1:8080/ -2. To see it from your phone - Once the server is running, - ``` - ngrok http http://127.0.0.1:8080/ - ``` +2. For the app to work properly from your phone, you'll need to serve it over HTTPS. The easiest way to do this is via a tunnel, such as: + a. ngrok: `ngrok http http://127.0.0.1:8080/` + b. [Microsoft Dev Tunnels](https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/overview): `devtunnel host -p 8080` + c. Many other [tunneling options](https://github.com/anderspitman/awesome-tunneling?tab=readme-ov-file) ## Third-party libraries used 1. [Turf.js](https://turfjs.org/) (for GeoJSON processingand geospatial calculations) diff --git a/vite.config.ts b/vite.config.ts index 6c78076..ceda7c8 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,11 +2,14 @@ import { defineConfig } from 'vite'; export default defineConfig({ root: './src', + // Use relative paths for assets, since our Github Pages deploy is not at the root + base: './', build: { outDir: '../dist', minify: false, emptyOutDir: true, rollupOptions: { + // Build both the main site and the activity simulator as separate pages input: { index: './src/index.html', replay_gpx: './src/replay_gpx.html',