Skip to content

Commit bb2d85a

Browse files
committed
urls
1 parent 4c51aa9 commit bb2d85a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/build/mdn-comments.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import fs from "fs/promises";
22
import * as path from "path";
3-
import { fileURLToPath } from "url";
43

5-
const __filename = fileURLToPath(import.meta.url);
6-
const __dirname = path.dirname(__filename);
4+
const basePath = new URL(
5+
"../../inputfiles/mdn/files/en-us/web/api/",
6+
import.meta.url,
7+
).pathname;
78

89
function extractSummary(markdown: string): string {
910
// Remove frontmatter (--- at the beginning)
@@ -73,11 +74,6 @@ async function getIndexMdContents(
7374
}
7475

7576
export async function generateDescription(): Promise<Record<string, string>> {
76-
const basePath = path.resolve(
77-
__dirname,
78-
"../inputfiles/mdn/files/en-us/web/api",
79-
);
80-
8177
try {
8278
const folders = await getFolders(basePath);
8379
if (folders.length > 0) {

0 commit comments

Comments
 (0)