We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9310427 commit d9c65eaCopy full SHA for d9c65ea
website/scripts/sitemap.ts
@@ -1,15 +1,26 @@
1
import fs from 'node:fs';
2
import path from 'node:path';
3
+import { fileURLToPath } from 'node:url';
4
import { findNestedFiles } from './utils/index';
5
6
const ORIGIN = 'https://valibot.dev';
7
8
// Find all route index files
9
const filePaths = findNestedFiles(
- [path.join('src', 'routes')],
10
+ [
11
+ path.join(
12
+ path.dirname(fileURLToPath(import.meta.url)),
13
+ '..',
14
+ 'src',
15
+ 'routes'
16
+ ),
17
+ ],
18
(fileName) => fileName === 'index.tsx' || fileName === 'index.mdx'
19
);
20
21
+console.log('dirname', path.dirname(fileURLToPath(import.meta.url)));
22
+console.log('filePaths', filePaths);
23
+
24
// Create URL paths and sort them
25
let urlSet = filePaths
26
// Transform file paths to URL paths
0 commit comments