-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
38 lines (33 loc) · 905 Bytes
/
nuxt.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { formatChannelId } from "./server/helpers/format-channel-id.js";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
app: {
baseURL: "/telehoraire-website/",
head: {
title: "Téléhoraire",
},
},
css: ["@picocss/pico/css/pico.css", "@picocss/pico/css/pico.colors.css"],
modules: ["@nuxt/image"],
image: {
domains: ["img.bouygtel.fr", "static-cdn.tv.sfr.net"],
},
hooks: {
// fetch async routes to prerender
"prerender:routes": async (ctx) => {
const data = await (
await fetch(new URL("tnt.prime.fr.json", process.env.SOURCE_API_URL))
).json();
if (data?.channels?.length > 0) {
for (const channel of data.channels) {
ctx.routes.add(`/chaine/${formatChannelId(channel.id)}`);
}
}
},
},
experimental: {
componentIslands: true,
},
devtools: { enabled: true },
compatibilityDate: "2024-04-03",
});