Skip to content

Fix dev deployment: copy content directory and use relative imports#44

Merged
MrAlders0n merged 3 commits intodevfrom
copilot/fix-dev-deployment-paths
Dec 18, 2025
Merged

Fix dev deployment: copy content directory and use relative imports#44
MrAlders0n merged 3 commits intodevfrom
copilot/fix-dev-deployment-paths

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Dev deployment at /dev was missing the /content/ directory and loading prod's wardrive.js due to absolute import paths.

Changes

GitHub Actions workflow (.github/workflows/deploy.yml)

  • Explicitly copy dev-content/content to _site/dev/content/ to ensure complete dev deployment

Import paths (index.html, content/wardrive.js)

  • Convert absolute paths to relative:
    - import { onLoad } from '/content/wardrive.js';
    + import { onLoad } from './content/wardrive.js';
    - import { WebBleConnection } from "/content/mc/index.js";
    + import { WebBleConnection } from "./mc/index.js";

This allows dev and prod deployments to load their respective versions of all content files independently.

Original prompt

Problem: Dev Deployment Using Wrong wardrive. js Path

Summary

The GitHub Pages deployment workflow creates two deployments:

  • Prod: from main branch, served at /
  • Dev: from dev branch, served at /dev

Changes to wardrive.js in the dev branch are not taking effect after deployment.

Root Cause

In index.html, the import uses an absolute path:

import { onLoad } from '/content/wardrive.js';

This always resolves to the prod version at /content/wardrive.js, even when the page is served from /dev/index.html. The dev deployment should be loading /dev/content/wardrive.js instead.

Evidence

Browser console shows that /dev/content/ does not contain wardrive.js—only the root /content/ directory does.

Additional Issue: Dev Deployment Missing Content Folder

The dev deployment at /dev only contains an index.html file. The /dev/content/ and /dev/content/mc/ folders are not being deployed at all. The GitHub Action needs to be updated to ensure the dev deployment is a complete copy of the dev branch, including:

  • /dev/content/wardrive.js
  • /dev/content/mc/* (all files in the mc subdirectory)
  • Any other assets in the /content/ directory

This will allow independent changes to be made and tested on any files in /content/ or /content/mc/ without affecting production.

Requested Fixes

  1. Update the GitHub Action to deploy the full /content/ directory (including /content/mc/) to /dev/content/ for the dev deployment.

  2. Change the import in index.html from an absolute path to a relative path:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 18, 2025 16:43
…orts

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect path for wardrive.js in Dev deployment Fix dev deployment: copy content directory and use relative imports Dec 18, 2025
Copilot AI requested a review from MrAlders0n December 18, 2025 16:47
@MrAlders0n MrAlders0n changed the base branch from main to dev December 18, 2025 16:49
@MrAlders0n MrAlders0n marked this pull request as ready for review December 18, 2025 16:49
@MrAlders0n MrAlders0n merged commit bd4c403 into dev Dec 18, 2025
@MrAlders0n MrAlders0n deleted the copilot/fix-dev-deployment-paths branch December 19, 2025 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants