Build each output for the environment where it will run.

Use the scripts defined by the project. Build offline.html for direct file playback, use portable or dist over HTTP, and treat PDF and PPTX as static exports.

Install dependencies and inspect the editable project

Run commands from the project folder and prefer the package manager and scripts already defined by that project.

Install dependencies

Use the project package manager and lockfile when present.

npm install

Start the development presentation

Open the printed local URL and inspect the current source project in a real browser.

npm run dev

Check the normal production build

Resolve missing imports, assets, fonts, or runtime errors before exporting.

npm run build

Build the single-file offline presentation

offline.html is the relocatable interactive output that may be copied alone and opened directly through file://.

Create the current offline file

Run this after the final source, style, font, image, or media change.

npm run build:offline

Open the copied file

Copy offline.html to another location, then open that copy in a current Chromium browser and verify direct file playback.

open ./offline.html

Serve portable and dist directories over HTTP

portable/ and dist/ are web directories. Keep every emitted file together and use a static HTTP server or host.

Create the compatible static-HTTP build

Use this output when the complete directory will be hosted or served over HTTP.

npm run build:portable

Serve it locally

Open the printed localhost address. Double-clicking portable/index.html or dist/index.html is not supported.

python3 -m http.server 4173 --directory portable

Export static review copies

PDF and PPTX preserve rendered pages, not the editable Slidev source or interactive runtime.

PDF and PPTX preserve rendered pages, not the editable Slidev source or interactive runtime.
OutputExample commandBehavior
PDFnpm run exportStatic pages for review, printing, and sharing; no Slidev interaction
PPTX compatibility copynpm run export -- --format pptxImage-based slide content; no native text editing and no Slidev interaction

Verify the output that will be delivered

A successful command is only the start; open the actual file or hosted build and inspect representative states.

  • Confirm the output is current

    Rebuild after the final relevant source change and confirm the output timestamp and path belong to this project.

  • Test a copied offline.html

    Open a copy through file:// with non-local network access unavailable. Check the first slide, direct hash navigation, keyboard navigation, local assets, interactions, and console.

  • Test the hosted directory through HTTP

    Check initial load, direct routes, assets, refresh behavior, interactions, and the browser console from the real hosted path.

  • Inspect PDF or PPTX pages

    Check page count, crop, font rendering, formulas, charts, logos, sources, and overflow in the actual exported file.

  • Report remaining limitations

    Name any interaction that requires the web version and every placeholder, missing asset, or unverified state.