File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Keep text imports isolated so protocol-only commands can run from source
2+ // before apps/hook/dist has been built.
3+ // @ts -ignore - Bun import attribute for text
4+ import planHtml from "../dist/index.html" with { type : "text" } ;
5+
6+ // @ts -ignore - Bun import attribute for text
7+ import reviewHtml from "../dist/review.html" with { type : "text" } ;
8+
9+ export const planHtmlContent = planHtml as unknown as string ;
10+ export const reviewHtmlContent = reviewHtml as unknown as string ;
Original file line number Diff line number Diff line change @@ -119,16 +119,20 @@ import path from "path";
119119
120120let planHtmlContentPromise : Promise < string > | undefined ;
121121let reviewHtmlContentPromise : Promise < string > | undefined ;
122+ let htmlAssetsPromise : Promise < typeof import ( "./html-assets" ) > | undefined ;
123+
124+ function getHtmlAssets ( ) {
125+ htmlAssetsPromise ??= import ( "./html-assets" ) ;
126+ return htmlAssetsPromise ;
127+ }
122128
123129function getPlanHtmlContent ( ) : Promise < string > {
124- planHtmlContentPromise ??= import ( "../dist/index.html" , { with : { type : "text" } } )
125- . then ( ( mod ) => mod . default as string ) ;
130+ planHtmlContentPromise ??= getHtmlAssets ( ) . then ( ( mod ) => mod . planHtmlContent ) ;
126131 return planHtmlContentPromise ;
127132}
128133
129134function getReviewHtmlContent ( ) : Promise < string > {
130- reviewHtmlContentPromise ??= import ( "../dist/review.html" , { with : { type : "text" } } )
131- . then ( ( mod ) => mod . default as string ) ;
135+ reviewHtmlContentPromise ??= getHtmlAssets ( ) . then ( ( mod ) => mod . reviewHtmlContent ) ;
132136 return reviewHtmlContentPromise ;
133137}
134138
You can’t perform that action at this time.
0 commit comments