[client-app] Fix build

Partially revert 3071856a8e

Symlinking instead of copying the error-logger-extensions prevents the
app from finding the appropriate dependencies required in the error
logger extensions in the main process and in the renderer processes
because globalPaths are only set in renderer processes and /after/
error-logger-extensions are loaded.

We should fix this properly in a separate diff, and move the error
logger to isomorphic-core instead of copying it or symlinking it
This commit is contained in:
Juan Tejada 2017-02-21 15:54:02 -08:00
parent 1105b2621f
commit 1485575e48

View file

@ -21,11 +21,11 @@ function unlinkIfExistsSync(p) {
}
}
function linkErrorLoggerExtensions(privateDir) {
const from = path.join(privateDir, 'src', 'error-logger-extensions')
const to = path.resolve(path.join('packages', 'client-app', 'src', 'error-logger-extensions'))
unlinkIfExistsSync(to);
fs.symlinkSync(from, to, 'dir');
function copyErrorLoggerExtensions(privateDir) {
const from = path.join(privateDir, 'src')
const to = path.resolve(path.join('packages', 'client-app', 'src'))
unlinkIfExistsSync(path.join(to, 'error-logger-extensions'));
fs.copySync(from, to);
}
async function installPrivateResources() {
@ -36,7 +36,7 @@ async function installPrivateResources() {
return;
}
linkErrorLoggerExtensions(privateDir)
copyErrorLoggerExtensions(privateDir)
// link private plugins
for (const plugin of fs.readdirSync(path.join(privateDir, 'packages'))) {