@mariozechner/hotserve
v0.1.2
Published
Minimal hot-reload development server
Readme
@mariozechner/hotserve
Minimal hot-reload development server. Zero config, zero bullshit.
Usage
npx @mariozechner/hotserve [options]Options
-p, --port <port>- Port to run server on (default: 4000)--path <mapping>- Path mapping in formatlocal-dir:route(can be specified multiple times)-v, --verbose- Verbose output-h, --help- Display help
Examples
Serve current directory on port 4000:
npx @mariozechner/hotserveServe on custom port:
npx @mariozechner/hotserve --port 3000Map multiple directories:
npx @mariozechner/hotserve --path dist:/static --path public:/ --port 8080Serve example folder at root and dist at /static:
npx @mariozechner/hotserve --path example:/ --path dist:/staticFeatures
- Auto-reload on file changes
- Injects reload script into HTML files automatically
- Disables caching for development
- Multiple path mappings
- Zero configuration needed
Development
# Clone and install
git clone https://github.com/badlogic/hotserve
cd hotserve
npm install
# Run locally
npx tsx src/cli.ts --path example:/ --port 4000
# Build
npm run buildPublishing
The publish.sh script handles versioning, tagging, and publishing:
# Patch release (1.0.0 -> 1.0.1)
./publish.sh
# Minor release (1.0.1 -> 1.1.0)
./publish.sh minor
# Major release (1.1.0 -> 2.0.0)
./publish.sh majorThe script will:
- Check for uncommitted changes
- Run checks (format, lint, type-check)
- Build the project
- Bump version in package.json
- Commit and tag the version
- Push to GitHub with tags
- Publish to npm
Manual publishing:
npm version patch # or minor/major
git push && git push --tags
npm run build
npm publish --access publicLicense
MIT
