npm install
npm run devnpm install
npm run build
npm run previewThe repository includes a GitHub Actions workflow that automatically builds and deploys to GitHub Pages when you push to the main branch.
- Go to your repository Settings → Pages
- Source: Deploy from a branch
- Branch:
gh-pages/root - Save
If you prefer to deploy manually:
# Build the project
npm run build
# The dist/ folder now contains the production build
# Upload dist/ contents to your web host- Connect your GitHub repository
- Build command:
npm run build - Publish directory:
dist
- Import your GitHub repository
- Framework Preset: Vite
- Build command:
npm run build - Output directory:
dist
- Build:
npm run build - Upload everything in the
dist/folder to your web server
The game requires no environment variables or backend services. It's a pure client-side Phaser 3 game with:
- LocalStorage for save data
- Procedural generation (no external assets)
- No API calls
If you see "Failed to load module script" errors:
- Make sure you're serving the built files from
dist/, not the source files - The development server (
npm run dev) handles TypeScript automatically - Production deployments need to serve the compiled JavaScript from
dist/
- Make sure your browser supports HTML5 Canvas
- Try a different browser (Chrome, Firefox, Safari, Edge all work)
- Check browser console for specific errors
- The game is optimized for modern browsers
- Disable browser extensions that might interfere
- Try a different device if performance is poor
The production build:
- Compiles TypeScript to JavaScript
- Bundles all code with Vite
- Minifies and optimizes assets
- Generates source maps for debugging
- Splits Phaser into a separate chunk for better caching
Output:
dist/index.html- Entry pointdist/assets/- Bundled JavaScript and assets
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
(Basically any modern browser with ES2020 support)