Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { components, fixtures } = getFilePaths(cosmosConfig);
const { proxiesPath } = cosmosConfig;
const contexts = getUniqueDirsOfUserModules(components, fixtures);
contexts.forEach(dirPath => {
// This ensures this loader is invalidated whenever a new component/fixture
// file is created or renamed, which leads succesfully uda ...
this.addDependency(dirPath);
});
return source
.replace(/COMPONENTS/g, convertPathMapToRequireCalls(components))
.replace(/FIXTURES/g, convertPathMapToRequireCalls(fixtures))
.replace(
/PROXIES/g,
moduleExists(proxiesPath) ? convertPathToRequireCall(proxiesPath) : '[]'
)
.replace(/CONTEXTS/g, convertDirPathsToContextCalls(contexts));
};