MCPcopy
hub / github.com/dilanx/craco / overrideModule

Function overrideModule

packages/craco/src/lib/cra.ts:61–67  ·  view source on GitHub ↗
(modulePath: string, newModule: any)

Source from the content-addressed store, hash-verified

59}
60
61function overrideModule(modulePath: string, newModule: any) {
62 if (!require.cache[modulePath]) {
63 throw new Error(`Module not found: ${modulePath}`);
64 }
65 require.cache[modulePath]!.exports = newModule;
66 log(`Overrode require cache for module: ${modulePath}`);
67}
68
69function resolvePackageJson(cracoConfig: CracoConfig) {
70 return require.resolve(

Callers 6

overrideCraPathsFunction · 0.85
overrideWebpackDevConfigFunction · 0.85
overrideDevServerUtilsFunction · 0.85

Calls 1

logFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…