vblog
Viewing readonly version: 247View latest version
Script
99
1
2
3
4
5
6
7
8
9
10
11
12
13
/** Import a file relative to the root of the project */
export async function importFile(path: string) {
const url = new URL(path, import.meta.url);
const res = await fetch(url, {
redirect: "follow",
headers: {
"Cache-Control": "max-age=3600",
},
});
if (!res.ok) return null;
return await res.text();
}
// consider replacing with: https://www.val.town/v/maxm/importProjectFile
H
www