YahooArchive / mendel

A build toolchain for experimentation on isomorphic web applications with tree-inheritance and multivariate support.
MIT License
88 stars 25 forks source link

Addressed the broken 'run' because of asynchronous network init #122

Closed stephanwlee closed 7 years ago

stephanwlee commented 7 years ago

Fixes #120

irae commented 7 years ago

👍 works for me.

There is a minimal problem with node@6 so I'll fix in master directly.

For reference, on node@6 there is no Object.values:

diff --git a/packages/mendel-outlet-browser-pack/src/index.js b/packages/mendel-outlet-browser-pack/src/index.js
index 6199a25..870c806 100644
--- a/packages/mendel-outlet-browser-pack/src/index.js
+++ b/packages/mendel-outlet-browser-pack/src/index.js
@@ -38,12 +38,12 @@ function matchVar(entries, multiVariations) {
 }

 function entriesHaveGlobalDep(entryMap, globalName) {
-    return Array.from(entryMap.values())
-        .some(({deps}) => {
-            return Object.values(deps).some(dep => dep.browser === globalName);
-        });
+    return Array.from(entryMap.values()).some(({deps}) => {
+        return Object.keys(deps)
+            .map(key => deps[key])
+            .some(dep => dep.browser === globalName);
+    });
 }
-
 module.exports = class BrowserPackOutlet {
     constructor(options) {
         this.config = options;