( title: string, html: string, entryFileName: string, )
| 80 | ); |
| 81 | |
| 82 | const getHtml = ( |
| 83 | title: string, |
| 84 | html: string, |
| 85 | entryFileName: string, |
| 86 | ): string => { |
| 87 | html = html.replace(IMPORT_MAP_SCRIPT_REGEX, '').trim(); |
| 88 | const headScripts = html.match(SCRIPTS_REGEX)?.join('\n')?.trim() ?? ''; |
| 89 | const body = html.replace(SCRIPTS_REGEX, '').trim(); |
| 90 | return prettier |
| 91 | .format( |
| 92 | ` |
| 93 | <!doctype html> |
| 94 | <html lang="en"> |
| 95 | <head> |
| 96 | <meta charset="utf-8" /> |
| 97 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 98 | <title>${title}</title> |
| 99 | ${headScripts} |
| 100 | </head> |
| 101 | <body> |
| 102 | ${body} |
| 103 | <script type="module" src="/${entryFileName}"></script> |
| 104 | </body> |
| 105 | </html> |
| 106 | `, |
| 107 | {parser: 'html'}, |
| 108 | ) |
| 109 | .trim(); |
| 110 | }; |
| 111 | |
| 112 | const getPackageJson = ( |
| 113 | title: string, |
no outgoing calls
no test coverage detected
searching dependent graphs…