2026-07-02 13:55:46 +02:00
|
|
|
// @ts-check
|
2026-06-24 14:00:13 +02:00
|
|
|
import { defineConfig } from 'astro/config';
|
|
|
|
|
import sitemap from '@astrojs/sitemap';
|
2026-07-02 13:55:46 +02:00
|
|
|
import { fileURLToPath } from 'node:url';
|
2026-06-24 14:00:13 +02:00
|
|
|
|
2026-07-02 14:46:55 +02:00
|
|
|
/**
|
|
|
|
|
* NDS's _typography.scss ships a Google Fonts `@import` which lands mid-file
|
|
|
|
|
* in the bundled CSS - invalid per spec (W3C error) and a hidden render
|
|
|
|
|
* blocker. The fonts are loaded via <link> in BaseLayout instead, and this
|
|
|
|
|
* plugin strips the stray @import from every emitted CSS asset.
|
|
|
|
|
*/
|
|
|
|
|
const stripFontImport = {
|
|
|
|
|
name: 'strip-google-fonts-import',
|
|
|
|
|
generateBundle(_, bundle) {
|
|
|
|
|
for (const chunk of Object.values(bundle)) {
|
|
|
|
|
if (chunk.type === 'asset' && chunk.fileName.endsWith('.css') && typeof chunk.source === 'string') {
|
|
|
|
|
chunk.source = chunk.source.replace(
|
|
|
|
|
/@import url\((['"]?)https:\/\/fonts\.googleapis\.com[^)]*\);?/g,
|
|
|
|
|
'',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
2026-07-02 13:55:46 +02:00
|
|
|
const ndsTokens = fileURLToPath(
|
|
|
|
|
new URL('./node_modules/@unkn0wndo3s/nova-design-system/src/styles/tokens', import.meta.url),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// https://astro.build/config
|
2026-06-24 14:00:13 +02:00
|
|
|
export default defineConfig({
|
|
|
|
|
site: 'https://louis-potevin.dev',
|
|
|
|
|
trailingSlash: 'ignore',
|
2026-07-02 13:55:46 +02:00
|
|
|
|
|
|
|
|
// About & Contact now live on the home timeline.
|
|
|
|
|
redirects: {
|
|
|
|
|
'/about': '/#about',
|
|
|
|
|
'/contact': '/#contact',
|
|
|
|
|
'/en/about': '/en/#about',
|
|
|
|
|
'/en/contact': '/en/#contact',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
i18n: {
|
|
|
|
|
defaultLocale: 'fr',
|
|
|
|
|
locales: ['fr', 'en'],
|
|
|
|
|
routing: {
|
|
|
|
|
prefixDefaultLocale: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
integrations: [
|
|
|
|
|
sitemap({
|
|
|
|
|
i18n: {
|
|
|
|
|
defaultLocale: 'fr',
|
|
|
|
|
locales: { fr: 'fr-FR', en: 'en-US' },
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
|
2026-06-24 14:00:13 +02:00
|
|
|
vite: {
|
2026-07-02 14:46:55 +02:00
|
|
|
plugins: [stripFontImport],
|
|
|
|
|
build: {
|
|
|
|
|
// Source maps help debugging in prod and satisfy Lighthouse's audit.
|
|
|
|
|
sourcemap: true,
|
|
|
|
|
},
|
2026-06-24 14:00:13 +02:00
|
|
|
css: {
|
|
|
|
|
preprocessorOptions: {
|
|
|
|
|
scss: {
|
2026-07-02 13:55:46 +02:00
|
|
|
loadPaths: [ndsTokens],
|
2026-06-24 14:00:13 +02:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|