MCPcopy Create free account
hub / github.com/stenciljs/core / findAndReplaceLoadModule

Function findAndReplaceLoadModule

scripts/esbuild/internal-platform-client.ts:110–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108 * @returns an Esbuild plugin
109 */
110export function findAndReplaceLoadModule(): Plugin {
111 return {
112 name: 'findAndReplaceLoadModule',
113 setup(build) {
114 build.onEnd(async (result) => {
115 for (const file of result.outputFiles!) {
116 const { path, text } = file;
117
118 await fs.writeFile(path, text.replace(/\${MODULE_IMPORT_PREFIX}/, './'));
119 }
120 });
121 },
122 };
123}
124
125async function copyPolyfills(opts: BuildOptions, outputInternalClientPolyfillsDir: string) {
126 const srcPolyfillsDir = join(opts.srcDir, 'client', 'polyfills');

Callers 1

getInternalClientBundlesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected