MCPcopy
hub / github.com/QwikDev/qwik / getLoaderJsonString

Function getLoaderJsonString

scripts/submodule-qwikloader.ts:69–78  ·  view source on GitHub ↗
(config: BuildConfig, name: string)

Source from the content-addressed store, hash-verified

67}
68
69const 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. */
81export async function inlineQwikScriptsEsBuild(config: BuildConfig) {

Callers 2

inlineQwikScriptsEsBuildFunction · 0.85
generateLoaderSubmoduleFunction · 0.85

Calls 2

readFileFunction · 0.90
joinFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…