MCPcopy Create free account
hub / github.com/awslabs/llrt / esbuildShimPlugin

Function esbuildShimPlugin

build.mjs:576–602  ·  view source on GitHub ↗
(shims)

Source from the content-addressed store, hash-verified

574 contents: `export default ${JSON.stringify(data)}`,
575 };
576 });
577 },
578};
579
580function esbuildShimPlugin(shims) {
581 return {
582 name: "esbuild-shim",
583 setup(build) {
584 shims.forEach(([filter, value], index) => {
585 build.onResolve(
586 {
587 filter,
588 },
589 (args) => ({
590 path: args.path,
591 namespace: `esbuild-shim-${index}-ns`,
592 })
593 );
594 build.onLoad(
595 { filter: /.*/, namespace: `esbuild-shim-${index}-ns` },
596 () => {
597 const contents = value || "export default {}";
598 return {
599 contents,
600 };
601 }
602 );
603 });
604 },
605 };

Callers 1

buildSdksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected