Look at the Nuxt 4 documentation to learn more.
Live preview version Template
- Nuxt a11y module
- Nuxt security module
- ESLint module
- Strict typeCheck (enabled in development)
- Pinia
- TailwindCSS
- Nuxt Icons
- Vue Use
- Nuxt Image
- Loaded a main scss entry file
- Injected scss utils which are globally available
- Works with Node 20.x
Make sure to install the dependencies:
# npm
npm installStart the development server on http://localhost:3000
npm run devBuild the application for production:
npm run buildLocally preview production build:
npm run previewCheck out the deployment documentation for more information.
app/
├── assets/ # Static assets (CSS, images, fonts)
│ └── css/
│ └── main.css # Main stylesheet with Tailwind imports
├── components/ # Reusable Vue components
├── layouts/ # Layout components
│ ├── default.vue
│ └── error.vue
├── pages/ # Route pages (auto-generated routes)
│ └── index.vue
├── plugins/ # Nuxt plugins
│ └── init.ts # App initialization plugin
├── store/ # Pinia stores
│ └── exampleStore.ts
├── app.vue # Root component
└── error.vue # Error handling component
public/ # Static files served as-is (favicon, etc.)
server/ # Server-side code and API routes
Copy .env.example to .env.local and configure as needed:
# Cache settings (optional)
# VITE_CACHE_ENABLED=trueThe project uses strict type checking in development mode. TypeScript files are validated during:
- Development (active checking)
- Build time (enforced checking)
To disable strict checking, modify nuxt.config.ts:
typescript: {
typeCheck: "build",
strict: false, // Disable strict mode
}Format and lint your code:
# Check for linting issues
npm run lint
# Fix linting issues
npm run eslint:fix
# Check formatting
npm run lint:prettier
# Fix formatting
npm run prettier:fix
# Fix all issues at once
npm run lint:fixPlace reusable components in app/components/:
<template>
<div>Your component</div>
</template>
<script setup lang="ts">
// Component logic here
</script>Components are automatically imported when referenced.
Create new stores in app/store/:
import { defineStore } from "pinia";
export const useMyStore = defineStore("my-store", () => {
const state = ref("");
const setState = (value: string) => {
state.value = value;
};
return { state, setState };
});Use in components:
const store = useMyStore();Add new pages in app/pages/:
index.vue→/about.vue→/aboutusers/[id].vue→/users/:id
Pages are automatically routed based on file structure.
If port 3000 is already in use, Nuxt will automatically try the next available port.
Run npm run typecheck to validate all TypeScript files without building.
Some rules are intentionally relaxed for flexibility. To adjust:
- Edit
eslint.config.mjs - Run
npm run eslint:fixto apply changes
This template includes several performance optimizations:
- Lazy hydration for non-critical components
- Automatic route prefetching
- Static data prerendering
- Build caching
- Image optimization with Nuxt Image
See Baseline Browser Mapping for browser support details.