Skip to content

Tooling, Testing & Deployment

If you have shipped a Next.js application you already own the mental model for this module: a CLI that drives dev/build/preview, TypeScript checking, a configuration file, an integration ecosystem, and a deployment target. Astro maps one-to-one to every one of those tools — the commands and file names just change.

Next.js / ReactAstro equivalent
next devastro dev
next buildastro build
next startastro preview
next lintastro check (type-checks .astro files)
next.config.jsastro.config.mjs
Next.js plugins (webpack)Astro integrations (@astrojs/*)
npm install @next/bundle-analyzernpx astro add react / npx astro add tailwind
Vercel / Netlify for Next.jsVercel / Netlify adapters for Astro
tsc --noEmitastro check covers .astro + .ts
Jest / VitestVitest (same config; Astro has no test runner)
LessonWhat you will learn
Astro CLIastro dev / build / preview / add / check; package.json scripts
Integrationsnpx astro add, astro.config.mjs, the integration ecosystem
astro checkType-checking .astro files, editor tooling, vs tsc/ESLint
Static vs SSRoutput: 'static' vs output: 'server', adapters, prerender
Deployastro build, static hosts, SSR adapters, GitHub Actions CI
Next.js config
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
images: { domains: ['cdn.example.com'] },
};
module.exports = nextConfig;
// package.json scripts (typical Next project)
// "dev": "next dev"
// "build": "next build"
// "start": "next start"
// "lint": "next lint"
// "type-check": "tsc --noEmit"
Astro config
// astro.config.mjs
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';
import tailwind from '@astrojs/tailwind';
export default defineConfig({
integrations: [react(), tailwind()],
});
// package.json scripts (typical Astro project)
// "dev": "astro dev"
// "build": "astro build"
// "preview": "astro preview"
// "check": "astro check"
Which Astro CLI command is the closest equivalent to `next build`?
What does `astro check` do that has no single Next.js equivalent?
In Astro, where does the build output land by default?