- run
pnpm dlx nuxi init <project-name>
pnpm install
- start dev server
pnpm dev -o
- create a
pages
directory - in pages dir, create .vue (eg. index.vue is '/' & about.vue is '/about')
- if folder is created in pages, name of folder will be added to route path
- components common pages
- create
layouts
folder in root default.vue
applied to all pagesdefinePageMeta()
for custom layouts for certain pages
- add 3rd party packages
pnpm add --save-dev @nuxtjs/tailwindcss
- Add
@nuxtjs/tailwindcss
to the modules section ofnuxt.config.{ts,js}
- create
./assets/css/tailwind.css
to customise tailwind
- default metadata in
nuxt.config.ts
file - page-specific metadata with
useHead()
or<Head></Head>
- create
server/api/
directory in root - create
<fileName>.js
inapi
folder - api endpoint would be
/api/<fileName>
- update
nuxt.config.ts
withruntimeConfig
- add
PNPM_FLAGS=--shamefully-hoist
in env variables if use pnpm