11import { build , emptyDir } from "@deno/dnt" ;
2+ import { parse } from "@std/jsonc" ;
23
34await emptyDir ( "./npm" ) ;
45
@@ -18,101 +19,16 @@ await Deno.writeTextFile(
1819 ) ,
1920) ;
2021
22+ const config = parse ( await Deno . readTextFile ( "./deno.jsonc" ) ) as {
23+ exports : Record < string , string > ;
24+ } ;
25+
2126await build ( {
2227 entryPoints : [
2328 "./mod.ts" ,
24- {
25- name : "./browser" ,
26- path : "./browser/mod.ts" ,
27- } ,
28- {
29- name : "./browser/dom" ,
30- path : "./browser/dom/mod.ts" ,
31- } ,
32- {
33- name : "./browser/websocket" ,
34- path : "./websocket/mod.ts" ,
35- } ,
36- {
37- name : "./parseAbsoluteLink" ,
38- path : "./parseAbsoluteLink.ts" ,
39- } ,
40- {
41- name : "./rest" ,
42- path : "./rest/mod.ts" ,
43- } ,
44- {
45- name : "./text" ,
46- path : "./text.ts" ,
47- } ,
48- {
49- name : "./title" ,
50- path : "./title.ts" ,
51- } ,
52- {
53- name : "./websocket" ,
54- path : "./websocket/mod.ts" ,
55- } ,
56- {
57- name : "./unstable-api" ,
58- path : "./api.ts" ,
59- } ,
60- {
61- name : "./unstable-api/pages" ,
62- path : "./api/pages.ts" ,
63- } ,
64- {
65- name : "./unstable-api/pages/project" ,
66- path : "./api/pages/project.ts" ,
67- } ,
68- {
69- name : "./unstable-api/pages/project/replace" ,
70- path : "./api/pages/project/replace.ts" ,
71- } ,
72- {
73- name : "./unstable-api/pages/project/replace/links" ,
74- path : "./api/pages/project/replace/links.ts" ,
75- } ,
76- {
77- name : "./unstable-api/pages/project/search" ,
78- path : "./api/pages/project/search.ts" ,
79- } ,
80- {
81- name : "./unstable-api/pages/project/search/query" ,
82- path : "./api/pages/project/search/query.ts" ,
83- } ,
84- {
85- name : "./unstable-api/pages/project/search/titles" ,
86- path : "./api/pages/project/search/titles.ts" ,
87- } ,
88- {
89- name : "./unstable-api/pages/project/title" ,
90- path : "./api/pages/project/title.ts" ,
91- } ,
92- {
93- name : "./unstable-api/pages/projects" ,
94- path : "./api/projects.ts" ,
95- } ,
96- {
97- name : "./unstable-api/pages/projects/project" ,
98- path : "./api/projects/project.ts" ,
99- } ,
100- {
101- name : "./unstable-api/pages/project/title/text" ,
102- path : "./api/pages/project/title/text.ts" ,
103- } ,
104- {
105- name : "./unstable-api/pages/project/title/icon" ,
106- path : "./api/pages/project/title/icon.ts" ,
107- } ,
108- {
109- name : "./unstable-api/users" ,
110- path : "./api/users.ts" ,
111- } ,
112- {
113- name : "./unstable-api/users/me" ,
114- path : "./api/users/me.ts" ,
115- } ,
29+ ...Object . entries ( config . exports ) . flatMap (
30+ ( [ name , path ] ) => name === "." ? [ ] : [ { name, path } ] ,
31+ ) ,
11632 ] ,
11733 outDir : "./npm" ,
11834 shims : { deno : "dev" } ,
0 commit comments