(config: BuildConfig, name: string)
| 67 | } |
| 68 | |
| 69 | const getLoaderJsonString = async (config: BuildConfig, name: string) => { |
| 70 | const filePath = join(config.distQwikPkgDir, name); |
| 71 | const content = await readFile(filePath, 'utf-8'); |
| 72 | // Remove vite comments and leading/trailing whitespace |
| 73 | let cleaned = content.trim().replace(/\n?\/\*\s*@vite[^*]+\*\/\n?/g, ''); |
| 74 | if (cleaned.endsWith(';')) { |
| 75 | cleaned = cleaned.slice(0, -1); |
| 76 | } |
| 77 | return JSON.stringify(cleaned); |
| 78 | }; |
| 79 | |
| 80 | /** Load each of the qwik scripts to be inlined with esbuild "define" as const variables. */ |
| 81 | export async function inlineQwikScriptsEsBuild(config: BuildConfig) { |
no test coverage detected
searching dependent graphs…