React

Next.js vs Vite for a marketing site: the HTML is the criterion

Next.js when every page must be HTML before JavaScript; Vite when the site is one page and the build stays fast. Numbers and a test.

Key points

  • Next.js pays off when every page must exist as HTML before JavaScript runs.
  • As of 1 November 2026 the next.js tag holds 41,492 questions on Stack Overflow and vite 6,809.
  • Vite is not a meta-framework: routing and per-route prerender must be added.
  • Of the 1,556 catalogue blocks, 1,459 declare "see source" as their licence: check it.

For a marketing site, Next.js pays off when pages must exist as HTML before the browser runs JavaScript; Vite pays off when the site is a single page with few routes and the build has to stay fast. The criterion is how many pages must be indexable, not which framework looks newer.

Question volume describes the complexity each tool brings: on 1 November 2026 the `next.js` tag held 41,492 questions on Stack Overflow and `vite` 6,809, six times fewer. The EneUI catalogue holds 1,556 ready blocks: 1,459 declare "see source" as their licence and 97 declare MIT.

What a marketing site must do

  • Be indexable: crawlers and social previews read the HTML, not the hydrated result.
  • Load fast: the landing page has the worst LCP, because it carries images and fonts.
  • Handle a form: contact, demo request, newsletter. You need an endpoint and an error state.
  • Stay cheap: few routes, frequent deploys, no service that scales on its own.

The routes that decide

Page typeNext.jsViteNote
LandingGenerated HTMLEmpty HTML without prerenderSEO and social previews
Legal pagesStaticStaticNo difference
Contact formRoute handler or server actionExternal endpointDepends on hosting
DeployNode runtime or static exportStatic filesCost and attack surface

Where Next.js pays the bill

Next.js adds a server, a cache and the boundary between server and client components. Those are three concepts the team must know, and they explain why the `next.js` tag holds 41,492 questions: most errors start at that boundary, not in the CSS.

If the site is one landing page with a form, that cost produces nothing. If you have ten product pages and a blog, static generation per route and metadata handling repay themselves in the first week.

Where Vite pays the bill

Vite produces a bundle and an `index.html` with an empty container. Content arrives after the JavaScript runs, so slow crawlers and social previews see a page without text. The fix is a prerender step, which has to be configured and kept alive.

The half-hour test

# il sito marketing minimo con Vite
npm create vite@latest sito-marketing -- --template react-ts
cd sito-marketing && npm install && npm run build

# quello che il crawler riceve davvero
node -e "console.log(require('fs').readFileSync('dist/index.html','utf8').length)"

If the number is under two thousand bytes, the HTML holds only the shell: the landing text sits in the bundle. The same check on Next.js shows the page HTML, because it was generated before the request.

The limit to write down

Named limitation of Vite: it is not a meta-framework. It has no router, no static generation per route and no server rendering: anyone who needs HTML for every URL adds a plugin or changes tool. On a one-page marketing site the limit stays invisible; with ten indexable pages it becomes the main cost.

Licences and costs

Next.js is MIT and Vite is MIT, so the licence does not decide. Hosting does: static files cost less than a Node runtime that must stay up. Copied blocks are a second check: 1,459 of 1,556 declare "see source", so the licence is verified record by record before publishing.

Heroes live in /blocks/category/hero, pricing sections in /blocks/category/pricing and page components in /components/cat/hero. For routing and framework boundaries read the structure of Next.js App Router, for what the page must contain what a website is for; the comparison of possible foundations is in WordPress, Wix or React components.

Frequently asked questions

Is Next.js mandatory for a marketing site?

No. It pays off when pages must be HTML before JavaScript. A single-page site works with Vite and a prerender step.

Can Vite generate static HTML per route?

Yes, with a prerender plugin or a meta-framework built on Vite. It is not part of the default configuration.

Which one is faster in development?

Vite starts a small project faster. Next.js adds server compilation, a cache and the component boundary.

Does Next.js cost more?

It depends on hosting: a Node runtime costs more than static files. The code is MIT in both cases.

Can I move from Vite to Next.js later?

Yes, if routes are few and components do not depend on the router. The cost sits in routing and data loading.