MCPcopy Create free account
hub / github.com/webpack/webpack-cli / registerTsxLoader

Method registerTsxLoader

packages/webpack-cli/src/webpack-cli.ts:2917–2927  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2915 // configuration file's location so the user's copy is picked up.
2916 // Requiring `tsx/cjs` installs its require hook as a side effect.
2917 const registerTsxLoader = (): Error | undefined => {
2918 try {
2919 createRequire(configFilePath)("tsx/cjs");
2920
2921 return undefined;
2922 } catch (err) {
2923 // `throw` may raise non-`Error` values; normalize so the
2924 // error-reporting path can rely on `.message`.
2925 return err instanceof Error ? err : new Error(String(err));
2926 }
2927 };
2928
2929 if (interpreted && !disableInterpret) {
2930 const rechoir: Rechoir = (await import("rechoir")).default;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected