Skip to content

Commit 8a4271f

Browse files
committed
add jspm-generator function
1 parent fb4bec9 commit 8a4271f

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

js/importmap-generator.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Generator } from "https://cdn.jsdelivr.net/gh/fusionstrings/dependencies@c59ae9dde8d5d339b3c0433d4b4f46e72739fafe/dist/deno/jspm.js";
2+
3+
async function main(subpath = "./js/main.js") {
4+
const generator = new Generator();
5+
6+
await generator.install([
7+
{
8+
alias: "@fusionstrings/river",
9+
target: "./",
10+
subpath,
11+
},
12+
]);
13+
const importMap = JSON.stringify(generator.getMap(), null, 2);
14+
return importMap;
15+
}
16+
17+
if (import.meta.main) {
18+
main();
19+
}
20+
21+
export { main }

0 commit comments

Comments
 (0)