Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds GitHub Pages deployment configuration and fixes asset path resolution for the demo application. The changes ensure that assets like SVG icons and 3D models load correctly when deployed to GitHub Pages with the repository-specific base path.
- Adds GitHub Actions workflow for automated deployment to GitHub Pages
- Configures Vite build settings to handle GitHub Pages base path in production
- Implements dynamic asset path resolution to support both local development and GitHub Pages deployment
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds new build and deploy scripts for GitHub Pages workflow |
| demo/vite.config.ts | Configures base path for GitHub Pages and build output settings |
| demo/src/App.tsx | Implements dynamic asset path resolution and updates hardcoded asset references |
| demo/package.json | Adds GitHub-specific build scripts with base path configuration |
| .github/workflows/deploy.yml | Creates GitHub Actions workflow for automated deployment |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| // https://vite.dev/config/ | ||
| export default defineConfig({ | ||
| export default defineConfig(({ command, mode }) => ({ | ||
| plugins: [react()], | ||
| }) | ||
| base: mode === 'production' ? '/TPS-Controls/' : '/', |
There was a problem hiding this comment.
The hardcoded repository name '/TPS-Controls/' creates a maintenance burden. Consider using an environment variable or deriving it from package.json to avoid manual updates if the repository is renamed.
| "dev": "vite", | ||
| "build": "tsc -b && vite build", | ||
| "build:github": "vite build --base=/TPS-Controls/", | ||
| "build:github-with-types": "tsc -b && vite build --base=/TPS-Controls/", |
There was a problem hiding this comment.
The script 'build:github-with-types' appears to be unused since the workflow uses 'build:github'. Consider removing it to avoid confusion, or document when it should be used instead.
| "build:github-with-types": "tsc -b && vite build --base=/TPS-Controls/", |
The deployment was not considering the name of the repo in the path for resource (model.glb). Fixes this error