diff --git a/react-packager/src/Server/index.js b/react-packager/src/Server/index.js index 0ce5c584..3e8ca9e8 100644 --- a/react-packager/src/Server/index.js +++ b/react-packager/src/Server/index.js @@ -131,13 +131,14 @@ Server.prototype._onFileChange = function(type, filepath, root) { Server.prototype._rebuildPackages = function() { var buildPackage = this.buildPackage.bind(this); var packages = this._packages; - Object.keys(packages).forEach(function(key) { - var options = getOptionsFromUrl(key); + + Object.keys(packages).forEach(function(optionsJson) { + var options = JSON.parse(optionsJson); // Wait for a previous build (if exists) to finish. - packages[key] = (packages[key] || Promise.resolve()).finally(function() { + packages[optionsJson] = (packages[optionsJson] || Promise.resolve()).finally(function() { // With finally promise callback we can't change the state of the promise // so we need to reassign the promise. - packages[key] = buildPackage(options).then(function(p) { + packages[optionsJson] = buildPackage(options).then(function(p) { // Make a throwaway call to getSource to cache the source string. p.getSource({ inlineSourceMap: options.inlineSourceMap, @@ -146,7 +147,7 @@ Server.prototype._rebuildPackages = function() { return p; }); }); - return packages[key]; + return packages[optionsJson]; }); }; @@ -228,9 +229,9 @@ Server.prototype._processDebugRequest = function(reqUrl, res) { res.end(ret); } else if (parts[1] === 'packages') { ret += '