This episode covers Nuxt tooling and build automation: using the Nuxt CLI and Vite effectively, TypeScript integration with strict typing, CI/CD pipelines for Nuxt applications, and linting, formatting, and pre-commit hooks for automating code quality.

Good developers delegate repetitive work to machines. Episode 19 covers modern tooling and build automation in Nuxt: making full use of the CLI and Vite, tightening TypeScript, building a CI/CD pipeline, and automating linting and formatting so quality is guaranteed on every commit.
This episode brings together a lot of what you've already built: ESLint and Prettier from episode 3, typecheck from episode 16, and tests from episode 16. All of it gets wired into a pipeline that runs automatically.
Nuxi provides the core commands you'll use every day:
npx nuxi dev
npx nuxi build
npx nuxi preview
npx nuxi typecheck
npx nuxi analyzenuxi dev runs the dev server, nuxi build builds for production, nuxi preview starts a server for the build output, while typecheck and analyze inspect code and bundles. npm scripts in package.json usually wrap these commands.
Nuxt uses Vite as the default bundler. Vite provides a fast dev server and an optimal build. Additional Vite configuration can be written in nuxt.config.ts:
export default defineNuxtConfig({
vite: {
server: {
hmr: { protocol: "ws" },
},
build: {
target: "esnext",
},
},
})The vite.build.target option sets the build target version — esnext leverages the latest JavaScript features for modern browsers.
Nuxt is TypeScript-native. Enable strict mode and make sure .vue files are checked too:
npx nuxi typecheckAdd "strict": true in tsconfig.json if it isn't already. Strict mode catches many potential bugs early — for example, null values used without checking.
Nuxt generates type declarations for auto-imports in .nuxt/imports.d.ts. Leverage useFetch and useAsyncData, which already have generic typing:
interface Produk {
id: string
nama: string
harga: number
}
const { data: produk } = await useFetch<Produk[]>("/api/produk")useFetch<Produk[]>("/api/produk") tells TypeScript the shape of the expected data. Errors accessing the wrong field are caught while typing, not when the application runs in production.
Set up a pipeline that runs typecheck, lint, and tests for every push:
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npx nuxt typecheck
- run: npx eslint .
- run: npm testThis pipeline runs typecheck, lint, and unit tests on every pull request. Adding an npm run build step ensures the project can always be built too.
The production pipeline adds build and deploy:
npm run buildThe build output is then deployed to the platform of your choice — deployment details are covered in episode 20. The key to good CI: every change that passes the pipeline is a safe release candidate.
Make sure committed code is clean by running lint and format automatically before committing:
npm install --save-dev husky lint-staged
npx husky initThen configure package.json:
{
"lint-staged": {
"*.{js,ts,vue}": ["eslint --fix", "prettier --write"]
}
}lint-staged only processes changed files, so it's fast. With husky, these commands run before every commit — bad code never reaches the repository.
The end result: developers write code, pre-commit tidies it, CI verifies it, and deployment happens automatically after it passes. Quality becomes built into the system, not dependent on memory.
Episode 19 wires your tooling into a system: nuxi commands and Vite for fast builds, strict TypeScript for type safety, CI/CD pipelines for automatic verification, and husky and lint-staged to enforce quality before code enters the repository.
Key takeaways:
nuxi dev, build, preview, and typecheck are the core daily commands.nuxt.config.ts.In the next episode, episode 20, we will discuss deployment and hosting — deployment options on Vercel, Netlify, Cloudflare, and self-hosting, Nitro deployment targets for serverless, managing build output and caching, and a production-ready deployment flow.