How can I optimize Nuxt build and dev server performance?

I’m working on a Nuxt blog project using content module, shad-cdn, and Tailwind CSS. The build process is painfully slow. It takes over 10 minutes to build with just 10 articles. This is way longer than a similar project I did with Bootstrap CDN.

I’m worried about scalability as I add more content. Every new Markdown file triggers a rebuild. I’m considering dropping Tailwind and shad-cdn to improve speed.

Here’s what my setup looks like:

{
  "dependencies": {
    "@nuxt/content": "^2.8.2",
    "@nuxtjs/tailwindcss": "^6.8.0",
    "nuxt": "^3.7.3",
    "shadcn-nuxt": "^0.1.0"
  },
  "devDependencies": {
    "@nuxtjs/color-mode": "^3.3.0",
    "@tailwindcss/typography": "^0.5.10"
  }
}

Any tips to speed up the dev server and build process? Is Nuxt Content suitable for larger blogs? I’d appreciate any advice on optimizing performance. Thanks!

yo grace, i feel ur pain! nuxt content can be a beast with lots of articles. have u tried using the ‘only’ option in nuxt.config.js to limit wat gets processed? also, maybe ditch shadcn-nuxt if u dont need all its components. tailwind’s purge can slow things down too, so tweak that if possible. good luck!

I’ve encountered similar issues with Nuxt build times. Have you considered implementing code splitting and lazy loading for your components? This can significantly reduce initial load times. Another approach is to leverage static site generation for your blog content, which can drastically improve build performance for content-heavy sites. Additionally, optimizing your images and other assets can make a noticeable difference. If you’re still facing issues, you might want to profile your build process to identify specific bottlenecks. Remember, sometimes the trade-off between development convenience and build performance is worth considering for long-term project sustainability.

I’ve been through this exact situation with Nuxt, and it can be frustrating. One thing that helped me tremendously was switching to incremental static regeneration (ISR) for my blog. It lets you build pages on-demand, so you’re not rebuilding everything for each change. Also, I found that optimizing my Tailwind config made a big difference - I stripped it down to just the classes I was actually using. Another trick is to use dynamic imports for heavy components that aren’t needed on every page. It took some trial and error, but these tweaks cut my build time by about 70%. Don’t give up on Nuxt Content just yet - with some optimization, it can handle large blogs pretty well.