text: 'use strict';
  
  var gulp = require('gulp');
  var uglify = require('gulp-uglify');
  var sourcemaps = require('gulp-sourcemaps');
  var rigger = require('gulp-rigger');
  var watch = require('gulp-watch');
  var browserSync = require("browser-sync");
  var reload = browserSync.reload;
  
  var path = {
      build: {
          html: 'build/examples',
          js: 'build/js/',
      },
      src: {
          html: 'src/examples/*.html',
          js: 'src/*.js',
      },
      watch: {
          html: 'src/**/*.html',
          js: 'src/**/*.js',
      }
  };
  
  var config = {
      server: {
          baseDir: "./build"
      },
      tunnel: true,
      host: 'localhost',
      port: 9000,
      logPrefix: "front-end"
  };
  
  gulp.task('webserver', function () {
      browserSync(config);
  });
  
  gulp.task('html:build', function () {
      gulp.src(path.src.html)
          .pipe(gulp.dest(path.build.html))
          .pipe(reload({stream: true}));
  });
  
  gulp.task('js:build', function () {
      gulp.src(path.src.js)
          .pipe(rigger())
          .pipe(sourcemaps.init())
          .pipe(uglify())
          .pipe(sourcemaps.write())
          .pipe(gulp.dest(path.build.js))
          .pipe(reload({stream: true}));
  });
  
  gulp.task('build', [
      'html:build',
      'js:build',
  ]);
  
  
  gulp.task('watch', function(){
      watch([path.watch.html], function(event, cb) {
          gulp.start('html:build');
      });
      watch([path.watch.js], function(event, cb) {
          gulp.start('js:build');
      });
  });
  
  
  gulp.task('default', ['build', 'webserver', 'watch']);
  