Build and configuration
Build and configuration
Section titled “Build and configuration”Markdown Live Preview is a static site built with Vite. This page is for users and contributors who want to build it from source or understand its configuration surface.
Prerequisites
Section titled “Prerequisites”- Node.js 22 (the version used by the container build and the supported baseline).
- npm (bundled with Node).
Build from source
Section titled “Build from source”npm cinpm run buildThe build output is written to dist/. Serve it with any static file server, or use the provided
scripts:
npm run preview # Vite preview servernpm run serve-dist # serve dist/ on port 5001A Makefile wraps the common tasks (make setup, make build, make dev, make preview,
make serve-dist).
Run a development server
Section titled “Run a development server”npm run devConfiguration surface
Section titled “Configuration surface”This is a client-only app; there are no server-side environment variables for application logic. The relevant configuration lives in a few files:
| File | Purpose |
|---|---|
nginx/default.conf | Content Security Policy, security headers, caching, and SPA fallback for the container. |
Dockerfile | Multi-stage build: Node 22 build stage → Nginx 1.27 runtime. Exposes port 80. |
docker-compose.yml | Local build-and-run with a healthcheck; maps 8080:80. |
charts/markdown-live-preview/values.yaml | Helm chart configuration (image, resources, probes, security context, ingress). |
Runtime behavior such as retention windows and the analytics measurement ID is defined in the
application source (src/main.js). Changing these is a code change, not deployment configuration.
There is no automated test suite in this repository. npm test is the upstream placeholder that
intentionally exits non-zero ("Error: no test specified") — it does not indicate a real failure
and is not a coverage signal. Verification relies on building, container smoke tests, chart checks,
and the documentation validator rather than a unit-test run.