l13 preview
Serve the built dist/
directory with Express for local testing.
Usage
npx l13 preview
Description
The preview
command starts a local Express server to serve your built game files. This is useful for testing your final build before submission, ensuring everything works correctly in a production-like environment.
How It Works
- Serves
dist/
Directory: Serves all files from thedist
folder - Express Server: Uses Express.js for reliable local hosting
- Static File Serving: Serves HTML, CSS, JS, and other assets
- Local Access: Provides a local URL for testing
Examples
# Serve the built files
npx l13 preview
# Typical output:
# Server running at http://localhost:3000
# Press Ctrl+C to stop
Use Cases
- Final Testing: Test your game after building
- Performance Testing: Check loading times and performance
- Cross-browser Testing: Test in different browsers
- Submission Preparation: Verify everything works before submitting
Workflow
- Build your game:
npx l13 build
- Preview the build:
npx l13 preview
- Open browser to the provided URL
- Test all game functionality
- Check file sizes and performance
Notes
- Make sure to run
npx l13 build
first to create thedist/
directory - The server runs on a default port (typically 3000)
- Press
Ctrl+C
to stop the server - This is a simple static file server - no hot reload or development features