 		.on 'error', onError
 
 # Execute stats
-gulp.task 'stats', ['plato']
+gulp.task 'stats', ['plato'], ->
+	if serve
+		startServer STATS_DIRECTORY
+		openApp STATS_DIRECTORY
 
 # Process styles
 gulp.task 'styles', ['less', 'css'], ->

isProd         = env.prod? or env.production?
isWindows      = /^win/.test(process.platform)
manifest       = {}
useBackendless = not (env.backend? or isProd)
useSpecs       = useBackendless


# Start a web server without rebuilding
gulp.task 'serve', ->
	startServer DIST_DIRECTORY
	openApp DIST_DIRECTORY

# Start a web server
gulp.task 'server', ['build'], ->
	startServer DIST_DIRECTORY

# Process SPA
gulp.task 'spa', ['scripts', 'styles'].concat(if isProd then 'templateCache' else 'views'), ->
