Files
NexStudio/astro.config.mjs
Javaxman 9017c933f4 Completa base SEO con sitemap robots e meta canonical OG
Aggiunge integrazione @astrojs/sitemap, pubblica robots.txt su nexstudio.ai e imposta canonical/OG/Twitter base nel layout principale.

Made-with: Cursor
2026-04-24 17:14:22 +02:00

55 lines
1.4 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// @ts-check
import { defineConfig } from 'astro/config';
import tailwindcss from '@tailwindcss/vite';
import cloudflare from '@astrojs/cloudflare';
import alpinejs from '@astrojs/alpinejs';
import sitemap from '@astrojs/sitemap';
/**
* Mitiga race su richieste SSR parallele durante lottimizzazione dipendenze
* (Astro + Cloudflare + Vite 7: file mancanti sotto `node_modules/.vite/deps_*`).
* Se lerrore persiste: `npm run dev:fresh` (cancella la cache Vite e riavvia).
*
* @returns {import('vite').Plugin}
*/
function viteSsrOptimizeIgnoreOutdated() {
return {
name: 'vite-ssr-optimize-ignore-outdated',
enforce: /** @type {'post'} */ ('post'),
/**
* @param {string} name
*/
configEnvironment(name) {
if (name === 'astro' || name === 'ssr' || name === 'prerender') {
return {
optimizeDeps: {
ignoreOutdatedRequests: true,
},
};
}
},
};
}
// https://astro.build/config
export default defineConfig({
/** Usato da Astro per URL assoluti (es. sitemap). Imposta il dominio di produzione. */
site: 'https://nexstudio.ai',
output: 'server', // per il deployment su Cloudflare Pages
vite: {
plugins: [tailwindcss(), viteSsrOptimizeIgnoreOutdated()],
},
adapter: cloudflare(),
integrations: [alpinejs(), sitemap()],
i18n: {
defaultLocale: 'it',
locales: ['it', 'en', 'th'],
routing: {
prefixDefaultLocale: false,
},
},
});