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

Function inlineQwikScriptsEsBuild

scripts/submodule-qwikloader.ts:81–97  ·  view source on GitHub ↗
(config: BuildConfig)

Source from the content-addressed store, hash-verified

79
80/** Load each of the qwik scripts to be inlined with esbuild "define" as const variables. */
81export async function inlineQwikScriptsEsBuild(config: BuildConfig) {
82 const variableToFileMap = [
83 ['QWIK_LOADER_DEFAULT_MINIFIED', 'qwikloader.js'],
84 ['QWIK_LOADER_DEFAULT_DEBUG', 'qwikloader.debug.js'],
85 ];
86
87 const define: { [varName: string]: string } = {};
88
89 await Promise.all(
90 variableToFileMap.map(async (varToFile) => {
91 const varName = `globalThis.${varToFile[0]}`;
92 define[varName] = await getLoaderJsonString(config, varToFile[1]);
93 })
94 );
95
96 return define;
97}
98
99async function generateLoaderSubmodule(config: BuildConfig) {
100 const loaderDistDir = join(config.distQwikPkgDir, 'loader');

Callers 2

submoduleServerFunction · 0.90
buildOptimizerFunction · 0.90

Calls 1

getLoaderJsonStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…