/* global browserSync, config, project, reloadPaths, server */

module.exports = function(grunt) {
	grunt.registerTask('sync', function() {
		var serverConfig = project.server,
			reloadConfig = project.server.reload;

		// Configure browser reloading
		if (reloadConfig.enable === true) {
			var reloadWatch = reloadConfig.watch,
				reloadExtensions = reloadWatch.extensions.join();

			if (reloadWatch.extensions.length > 1) {
				reloadExtensions = '{' + reloadExtensions + '}';
			}

			// Add user-defined paths
			reloadWatch.paths.forEach(function(path) {
				reloadPaths.push('../../' + path + '/**/*.' + reloadExtensions);
			});

			// Add root to watchlist
			if (reloadWatch.root === true) {
				reloadPaths.unshift(config.paths.root + '/**/*.' + reloadExtensions);
			}

			// Bind BrowserSync watchlist
			reloadPaths.unshift(
				config.paths.assets +
				'**/*.{min.css,min.js,gif,jpg,png,svg,webp,woff}'
			);

			server.files = reloadPaths;
		}

		// Ghost mode
		if (serverConfig.ghostMode !== true) {
			server.ghostMode = serverConfig.ghostMode || false;
		}

		server.port = serverConfig.port;
		server.logPrefix = 'Wee';
		server.open = 'external';
		server.notify = false;

		server.ui = {
			port: serverConfig.port + 1,
			weinre: {
				port: serverConfig.port + 100
			}
		};

		browserSync(server);
	});
};
@@ -330,33 +330,30 @@
 ,%0A%09%09%09%09reload
-Extension
+Helper
 s = reloadWa
@@ -430,25 +430,22 @@
 %09%09reload
-Extension
+Helper
 s = '%7B' 
@@ -452,25 +452,22 @@
 + reload
-Extension
+Helper
 s + '%7D';
@@ -600,33 +600,30 @@
 *.' + reload
-Extension
+Helper
 s);%0A%09%09%09%7D);%0A%0A
@@ -751,17 +751,14 @@
 load
-Extension
+Helper
 s);%0A

Update additional references to renamed generator extensions