Performance: Dev server and build process
This concept affects the initial page load speed and developer experience by controlling how code is served and optimized before reaching the browser.
astro dev
astro build && npx serve dist
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Dev server without HMR | N/A | N/A | Blocks rendering during reload | [X] Bad |
| Dev server with HMR | N/A | N/A | Instant updates, no full reload | [OK] Good |
| Build without minify/split | N/A | N/A | Large bundle delays paint | [X] Bad |
| Build with minify and split | N/A | N/A | Smaller bundle speeds paint | [OK] Good |
astro dev command in Astro?astro devastro dev command runs a local server that watches your files and reloads the browser when you make changes.astro build) creates optimized files for publishing, not live updates.astro dev creates production filesastro dev installs packagesastro build is used to create optimized production files for deployment.astro start, astro run, and astro serve are not valid build commands in Astro.astro start instead of astro buildastro serve with build commandastro run which doesn't existastro dev astro build astro dev
astro dev command?astro dev behaviorastro dev, it starts a fresh development server with live reload, independent of previous builds.astro build creates production files but does not prevent running astro dev again later.astro dev [OK]astro build but the output folder is empty. What is the most likely cause?astro build requires valid Astro files; syntax errors prevent successful build output.astro dev is not required before build; build works locally before publishing; missing package.json usually causes install errors, not empty build.astro build with image optimization enabled and remove unused CSS -> Option APass the test and this pattern moves unknown