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

Function buildMiddlewareNode

scripts/qwik-city.ts:536–562  ·  view source on GitHub ↗
(config: BuildConfig)

Source from the content-addressed store, hash-verified

534}
535
536async function buildMiddlewareNode(config: BuildConfig) {
537 const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'node', 'index.ts')];
538
539 const external = ['node-fetch', 'undici', 'path', 'os', 'fs', 'url', ...MIDDLEWARE_EXTERNALS];
540
541 await build({
542 entryPoints,
543 outfile: join(config.distQwikCityPkgDir, 'middleware', 'node', 'index.mjs'),
544 bundle: true,
545 platform: 'node',
546 target: nodeTarget,
547 format: 'esm',
548 external,
549 plugins: [resolveRequestHandler('../request-handler/index.mjs')],
550 });
551
552 await build({
553 entryPoints,
554 outfile: join(config.distQwikCityPkgDir, 'middleware', 'node', 'index.cjs'),
555 bundle: true,
556 platform: 'node',
557 target: nodeTarget,
558 format: 'cjs',
559 external,
560 plugins: [resolveRequestHandler('../request-handler/index.cjs')],
561 });
562}
563
564async function buildMiddlewareRequestHandler(config: BuildConfig) {
565 const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'request-handler', 'index.ts')];

Callers 1

buildQwikCityFunction · 0.85

Calls 3

joinFunction · 0.85
resolveRequestHandlerFunction · 0.85
buildFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…