Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
R.forEach(appName => {
const manifestFilePath = path.join(buildDirectory, appName, manifestFileName);
const manifest = fs.readJsonSync(manifestFilePath, 'utf8');
const hash = getHash(appName, manifest);
fs.writeFileSync(getLiferayFilePath(appName, hash), getLoaderSource(appName, manifest), 'utf8');
fs.appendFileSync(
configFilePath,
createLiferayConfigSource({
name: appName,
exportsIdentifier: R_.toCamelCase(appName),
path: getLiferayContextPath(appName, hash),
}),
'utf8'
);
})(appsAvailable);
};
const getLoaderSource = (appName, manifest) => {
const paths = getEntryBundlesFromManifest(manifest);
const loadScripts = getLoadScriptsSrc(paths);
return `${joinByNewline(loadScripts)}\nwindow.${R_.toCamelCase(appName)} = {};\n`;
};