1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-11 20:15:01 +00:00
mon-entreprise/site/build/build-sitemap.ts
Johan Girod b28fd65586 Revert "fix: change node version to 21"
This reverts commit 4b5e946eb9.

# Conflicts:
#	site/package.json
#	yarn.lock
2023-12-15 10:18:21 +01:00

22 lines
678 B
TypeScript

import { writeFileSync } from 'node:fs'
import { absoluteSitePaths, generateSiteMap } from '../source/sitePaths.js'
const basePathEn =
process.env.VITE_EN_BASE_URL ?? 'http://localhost:3000/infrance'
const basePathFr =
process.env.VITE_FR_BASE_URL ?? 'http://localhost:3000/mon-entreprise'
const enSiteMap = generateSiteMap(absoluteSitePaths.en).map(
(path) => basePathEn + path
)
const frSiteMap = generateSiteMap(absoluteSitePaths.fr).map(
(path) => basePathFr + path
)
writeFileSync('source/public/sitemap.en.txt', enSiteMap.join('\n') + '\n', {
encoding: 'utf8',
})
writeFileSync('source/public/sitemap.fr.txt', frSiteMap.join('\n') + '\n', {
encoding: 'utf8',
})