'use strict';
/**
 * lite-server : Simple server for angular/SPA projects
 *
 * Simply loads some default browser-sync options that apply to SPAs,
 * applies custom config overrides from user's own local `bs-config.{js|json}` file,
 * and launches browser-sync.
 */
var browserSync = require('browser-sync').create();
var path = require('path');
var _ = require('lodash');

// Load defaults
var options = require('./config-defaults');

// Load optional browser-sync config file from user's project dir
var bsConfigPath = path.resolve('bs-config');
var overrides = {};
try {
  overrides = require(bsConfigPath);
} catch (err) { } // silent: optional load
_.merge(options, overrides);

// Fixes browsersync error when overriding middleware array
if (options.server.middleware) {
  options.server.middleware = _.compact(options.server.middleware);
}

// Run browser-sync
browserSync.init(options);

@@ -623,35 +623,86 @@
 r) %7B
- %7D // silent: optional load
+%0A  if (!(err.code && err.code === 'MODULE_NOT_FOUND')) %7B%0A    throw(err);%0A  %7D%0A%7D
 %0A_.m

add error handling