Looking for a solution to ensure that Vue pages are fully generated as static HTML files in Nuxt even when they are simple and don't require any dynamic data fetching? Let's dig into the issue.
<template>
<div>hello world</div>
</template>
When running nuxt generate
, you may have noticed that the resulting HTML file, dist/index.html
, doesn't contain the expected "hello world". This indicates that the generated site isn't entirely static and still relies on browser rendering for JavaScript execution.
This can pose problems for search engine indexing since the HTML content of Vue pages might not be visible. Is there a way to overcome this limitation and have Nuxt produce fully static HTML files, especially for pages without asyncData
or fetch
methods?