diff --git a/app.js b/app.js index 12ef392ab3..3063c10314 100644 --- a/app.js +++ b/app.js @@ -40,20 +40,26 @@ } // Override bundles.json for HTTP requests - app.use('/' + BUNDLE_FILE, function (req, res) { - var bundles = JSON.parse(fs.readFileSync(BUNDLE_FILE, 'utf8')); - - // Handle command line inclusions/exclusions - bundles = bundles.concat(options.include); - bundles = bundles.filter(function (bundle) { - return options.exclude.indexOf(bundle) === -1; - }); - bundles = bundles.filter(function (bundle, index) { // Uniquify - return bundles.indexOf(bundle) === index; - }); - - res.send(JSON.stringify(bundles)); - }); + //app.use('/' + BUNDLE_FILE, function (req, res) { + // var bundles; + // + // try { + // bundles = JSON.parse(fs.readFileSync(BUNDLE_FILE, 'utf8')); + // } catch (e) { + // bundles = []; + // } + // + // // Handle command line inclusions/exclusions + // bundles = bundles.concat(options.include); + // bundles = bundles.filter(function (bundle) { + // return options.exclude.indexOf(bundle) === -1; + // }); + // bundles = bundles.filter(function (bundle, index) { // Uniquify + // return bundles.indexOf(bundle) === index; + // }); + // + // res.send(JSON.stringify(bundles)); + //}); // Expose everything else as static files app.use(express['static']('.')); diff --git a/bundles.json b/bundles.json deleted file mode 100644 index 852179dddb..0000000000 --- a/bundles.json +++ /dev/null @@ -1,38 +0,0 @@ -[ - "platform/framework", - "platform/core", - "platform/representation", - "platform/commonUI/about", - "platform/commonUI/edit", - "platform/commonUI/dialog", - "platform/commonUI/formats", - "platform/commonUI/general", - "platform/commonUI/inspect", - "platform/commonUI/mobile", - "platform/commonUI/themes/espresso", - "platform/commonUI/notification", - "platform/containment", - "platform/execution", - "platform/telemetry", - "platform/features/clock", - "platform/features/events", - "platform/features/imagery", - "platform/features/layout", - "platform/features/pages", - "platform/features/plot", - "platform/features/scrolling", - "platform/features/timeline", - "platform/forms", - "platform/identity", - "platform/persistence/aggregator", - "platform/persistence/local", - "platform/persistence/queue", - "platform/policy", - "platform/entanglement", - "platform/search", - "platform/status", - - "example/imagery", - "example/eventGenerator", - "example/generator" -] diff --git a/platform/framework/src/load/BundleLoader.js b/platform/framework/src/load/BundleLoader.js index ee6fb0a0e9..9389207ea8 100644 --- a/platform/framework/src/load/BundleLoader.js +++ b/platform/framework/src/load/BundleLoader.js @@ -130,7 +130,20 @@ define( // Load all bundles named in the referenced file. The file is // presumed to be a JSON file function loadBundlesFromFile(listFile) { - return getJSON(listFile).then(loadBundlesFromArray); + function handleError(err) { + $log.info([ + "No external bundles loaded;", + "could not load bundle listing in", + listFile, + "due to error", + err.status, + err.statusText + ].join(' ')); + return loadBundlesFromArray([]); + } + + return getJSON(listFile) + .then(loadBundlesFromArray, handleError); } return Array.isArray(bundles) ? loadBundlesFromArray(bundles) :