<commit_before>"use strict";

var gulp = require('gulp'),
  	gutil = require('gulp-util'),
  	plumber = require('gulp-plumber'),
    jshint = require('gulp-jshint'),
    sh = require('shelljs'),
    shell = require('gulp-shell'),
    concat = require('gulp-concat'),
    uglify  = require('gulp-uglify'),

    _pkg = require('./package.json'),
    _fs = require('fs'),
    _path = require('path'),
    _now = new Date(),
    _replacements = {
        NAME : _pkg.name,
        DESCRIPTION: _pkg.description,
        AUTHOR : _pkg.author.name,
        AUTHOR_URL: _pkg.author.url,
        VERSION_NUMBER : _pkg.version,
        HOMEPAGE : _pkg.homepage,
        LICENSE : _pkg.license,
        BUILD_DATE : _now.getUTCFullYear() +'/'+ pad(_now.getUTCMonth() + 1) +'/'+ pad(_now.getUTCDate()) +' '+ pad(_now.getUTCHours()) +':'+ pad(_now.getUTCMinutes())
    };
;

var FILE_ENCODING = 'utf-8',
    SRC_DIR = 'src',
    DIST_DIR = 'dist',
    DIST_NAME = 'f.js',
    DIST_MIN_NAME = 'f.min.js',
    DIST_PATH = DIST_DIR +'/'+ DIST_NAME,
    DIST_MIN_PATH = DIST_DIR +'/'+ DIST_MIN_NAME;

var onError = function(error){
  	gutil.beep();
  	console.log(error);
};

function readFile(filePath) {
    return _fs.readFileSync(filePath, FILE_ENCODING);
}

function tmpl(template, data, regexp){
    function replaceFn(match, prop){
        return (prop in data)? data[prop] : '';
    }
    return template.replace(regexp || /::(\w+)::/g, replaceFn);
}

function pad(val){
    val = String(val);
    if (val.length < 2) {
        return '0'+ val;
    } else {
        return val;
    }
}

gulp.task('default', ['lint', 'purge-deploy', 'build']);

gulp.task('purge-deploy', function(){
    [DIST_PATH, DIST_MIN_PATH].forEach(function(filePath){
        if( _fs.existsSync(filePath) ){
            _fs.unlinkSync(filePath);
        }
    });
});

gulp.task('build', function(){
    var wrapper = readFile('src/wrapper.js'),
        deploy  = tmpl(wrapper, {
            f          : readFile('src/f.js'),
            dispatcher : readFile('src/dispatcher.js'),
            injector   : readFile('src/injector.js'),
            router     : readFile('src/router.js'),
            core       : readFile('src/core.js'),
            sandbox    : readFile('src/sandbox.js'),
            store      : readFile('src/store.js'),
            extension  : readFile('src/extension.js'),
            module     : readFile('src/module.js')
        }, /\/\/::(\w+)::\/\//g);
    _fs.writeFileSync(DIST_PATH, tmpl(deploy, _replacements), FILE_ENCODING);
});

gulp.task('minify', function(){
    gulp.src(['dist/f.js'])
    .pipe(uglify({preserveComments: 'some'}))
    .pipe(concat('f.min.js'))
    .pipe(gulp.dest('dist/'));
});

gulp.task('watch', function(){
	gulp.watch('src/**/*.*', ['default']);
});

gulp.task('lint', function(){
    return gulp.src('./src/**/*.js')
        .pipe(jshint())
        .pipe(jshint.reporter('default'));
});
<commit_msg>lint example code<commit_after>"use strict";

var gulp = require('gulp'),
  	gutil = require('gulp-util'),
  	plumber = require('gulp-plumber'),
    jshint = require('gulp-jshint'),
    sh = require('shelljs'),
    shell = require('gulp-shell'),
    concat = require('gulp-concat'),
    uglify  = require('gulp-uglify'),

    _pkg = require('./package.json'),
    _fs = require('fs'),
    _path = require('path'),
    _now = new Date(),
    _replacements = {
        NAME : _pkg.name,
        DESCRIPTION: _pkg.description,
        AUTHOR : _pkg.author.name,
        AUTHOR_URL: _pkg.author.url,
        VERSION_NUMBER : _pkg.version,
        HOMEPAGE : _pkg.homepage,
        LICENSE : _pkg.license,
        BUILD_DATE : _now.getUTCFullYear() +'/'+ pad(_now.getUTCMonth() + 1) +'/'+ pad(_now.getUTCDate()) +' '+ pad(_now.getUTCHours()) +':'+ pad(_now.getUTCMinutes())
    };
;

var FILE_ENCODING = 'utf-8',
    SRC_DIR = 'src',
    DIST_DIR = 'dist',
    DIST_NAME = 'f.js',
    DIST_MIN_NAME = 'f.min.js',
    DIST_PATH = DIST_DIR +'/'+ DIST_NAME,
    DIST_MIN_PATH = DIST_DIR +'/'+ DIST_MIN_NAME;

var onError = function(error){
  	gutil.beep();
  	console.log(error);
};

function readFile(filePath) {
    return _fs.readFileSync(filePath, FILE_ENCODING);
}

function tmpl(template, data, regexp){
    function replaceFn(match, prop){
        return (prop in data)? data[prop] : '';
    }
    return template.replace(regexp || /::(\w+)::/g, replaceFn);
}

function pad(val){
    val = String(val);
    if (val.length < 2) {
        return '0'+ val;
    } else {
        return val;
    }
}

gulp.task('default', ['lint', 'purge-deploy', 'build']);

gulp.task('purge-deploy', function(){
    [DIST_PATH, DIST_MIN_PATH].forEach(function(filePath){
        if( _fs.existsSync(filePath) ){
            _fs.unlinkSync(filePath);
        }
    });
});

gulp.task('build', function(){
    var wrapper = readFile('src/wrapper.js'),
        deploy  = tmpl(wrapper, {
            f          : readFile('src/f.js'),
            dispatcher : readFile('src/dispatcher.js'),
            injector   : readFile('src/injector.js'),
            router     : readFile('src/router.js'),
            core       : readFile('src/core.js'),
            sandbox    : readFile('src/sandbox.js'),
            store      : readFile('src/store.js'),
            extension  : readFile('src/extension.js'),
            module     : readFile('src/module.js')
        }, /\/\/::(\w+)::\/\//g);
    _fs.writeFileSync(DIST_PATH, tmpl(deploy, _replacements), FILE_ENCODING);
});

gulp.task('minify', function(){
    gulp.src(['dist/f.js'])
    .pipe(uglify({preserveComments: 'some'}))
    .pipe(concat('f.min.js'))
    .pipe(gulp.dest('dist/'));
});

gulp.task('watch', function(){
	gulp.watch('src/**/*.*', ['default']);
});

gulp.task('lint', function(){
    return gulp.src(['./src/**/*.js', './examples/**/*.js'])
        .pipe(jshint())
        .pipe(jshint.reporter('default'));
});
<|endoftext|>


<commit_before>var gulp = require('gulp');
var gutil = require('gulp-util');
var gulpif = require('gulp-if');
var streamify = require('gulp-streamify');
var autoprefixer = require('gulp-autoprefixer');
var cssmin = require('gulp-cssmin');
var less = require('gulp-less');
var concat = require('gulp-concat');
var plumber = require('gulp-plumber');
var source = require('vinyl-source-stream');
var babelify = require('babelify');
var browserify = require('browserify');
var watchify = require('watchify');
var uglify = require('gulp-uglify');

var production = process.env.NODE_ENV === 'production';

var dependencies = [
  'alt',
  'react',
  'react-router',
  'underscore'
];

/*
 |--------------------------------------------------------------------------
 | Combine all JS libraries into a single file for fewer HTTP requests.
 |--------------------------------------------------------------------------
 */
gulp.task('vendor', function() {
  return gulp.src([
    'bower_components/jquery/dist/jquery.js',
    'bower_components/bootstrap/dist/js/bootstrap.js',
    'bower_components/magnific-popup/dist/jquery.magnific-popup.js',
    'bower_components/toastr/toastr.js'
  ]).pipe(concat('vendor.js'))
    .pipe(gulpif(production, uglify({ mangle: false })))
    .pipe(gulp.dest('public/js'));
});

/*
 |--------------------------------------------------------------------------
 | Compile third-party dependencies separately for faster performance.
 |--------------------------------------------------------------------------
 */
gulp.task('browserify-vendor', function() {
  return browserify()
    .require(dependencies)
    .bundle()
    .pipe(source('vendor.bundle.js'))
    .pipe(gulpif(production, streamify(uglify({ mangle: false }))))
    .pipe(gulp.dest('public/js'));
});

/*
 |--------------------------------------------------------------------------
 | Compile only project files, excluding all third-party dependencies.
 |--------------------------------------------------------------------------
 */
gulp.task('browserify', ['browserify-vendor'], function() {
  return browserify('app/main.js')
    .external(dependencies)
    .transform(babelify)
    .bundle()
    .pipe(source('bundle.js'))
    .pipe(gulpif(production, streamify(uglify({ mangle: false }))))
    .pipe(gulp.dest('public/js'));
});

/*
 |--------------------------------------------------------------------------
 | Same as browserify task, but will also watch for changes and re-compile.
 |--------------------------------------------------------------------------
 */
gulp.task('browserify-watch', ['browserify-vendor'], function() {
  var bundler = watchify(browserify('app/main.js', watchify.args));
  bundler.external(dependencies);
  bundler.transform(babelify);
  bundler.on('update', rebundle);
  return rebundle();

  function rebundle() {
    var start = Date.now();
    return bundler.bundle()
      .on('error', function(err) {
        gutil.log(gutil.colors.red(err.toString()));
      })
      .on('end', function() {
        gutil.log(gutil.colors.green('Finished rebundling in', (Date.now() - start) + 'ms.'));
      })
      .pipe(source('bundle.js'))
      .pipe(gulp.dest('public/js/'));
  }
});

/*
 |--------------------------------------------------------------------------
 | Compile LESS stylesheets.
 |--------------------------------------------------------------------------
 */
gulp.task('styles', function() {
  return gulp.src('app/stylesheets/main.less')
    .pipe(plumber())
    .pipe(less())
    .pipe(autoprefixer())
    .pipe(gulpif(production, cssmin()))
    .pipe(gulp.dest('public/css'));
});

gulp.task('watch', function() {
  gulp.watch('app/stylesheets/**/*.less', ['styles']);
});

gulp.task('default', ['styles', 'vendor', 'browserify-watch', 'watch']);
gulp.task('build', ['styles', 'vendor', 'browserify']);<commit_msg>added react-dom to gulp browserify<commit_after>var gulp = require('gulp');
var gutil = require('gulp-util');
var gulpif = require('gulp-if');
var streamify = require('gulp-streamify');
var autoprefixer = require('gulp-autoprefixer');
var cssmin = require('gulp-cssmin');
var less = require('gulp-less');
var concat = require('gulp-concat');
var plumber = require('gulp-plumber');
var source = require('vinyl-source-stream');
var babelify = require('babelify');
var browserify = require('browserify');
var watchify = require('watchify');
var uglify = require('gulp-uglify');

var production = process.env.NODE_ENV === 'production';

var dependencies = [
  'alt',
  'react',
  'react-dom',
  'react-router',
  'underscore'
];

/*
 |--------------------------------------------------------------------------
 | Combine all JS libraries into a single file for fewer HTTP requests.
 |--------------------------------------------------------------------------
 */
gulp.task('vendor', function() {
  return gulp.src([
    'bower_components/jquery/dist/jquery.js',
    'bower_components/bootstrap/dist/js/bootstrap.js',
    'bower_components/magnific-popup/dist/jquery.magnific-popup.js',
    'bower_components/toastr/toastr.js'
  ]).pipe(concat('vendor.js'))
    .pipe(gulpif(production, uglify({ mangle: false })))
    .pipe(gulp.dest('public/js'));
});

/*
 |--------------------------------------------------------------------------
 | Compile third-party dependencies separately for faster performance.
 |--------------------------------------------------------------------------
 */
gulp.task('browserify-vendor', function() {
  return browserify()
    .require(dependencies)
    .bundle()
    .pipe(source('vendor.bundle.js'))
    .pipe(gulpif(production, streamify(uglify({ mangle: false }))))
    .pipe(gulp.dest('public/js'));
});

/*
 |--------------------------------------------------------------------------
 | Compile only project files, excluding all third-party dependencies.
 |--------------------------------------------------------------------------
 */
gulp.task('browserify', ['browserify-vendor'], function() {
  return browserify('app/main.js')
    .external(dependencies)
    .transform(babelify)
    .bundle()
    .pipe(source('bundle.js'))
    .pipe(gulpif(production, streamify(uglify({ mangle: false }))))
    .pipe(gulp.dest('public/js'));
});

/*
 |--------------------------------------------------------------------------
 | Same as browserify task, but will also watch for changes and re-compile.
 |--------------------------------------------------------------------------
 */
gulp.task('browserify-watch', ['browserify-vendor'], function() {
  var bundler = watchify(browserify('app/main.js', watchify.args));
  bundler.external(dependencies);
  bundler.transform(babelify);
  bundler.on('update', rebundle);
  return rebundle();

  function rebundle() {
    var start = Date.now();
    return bundler.bundle()
      .on('error', function(err) {
        gutil.log(gutil.colors.red(err.toString()));
      })
      .on('end', function() {
        gutil.log(gutil.colors.green('Finished rebundling in', (Date.now() - start) + 'ms.'));
      })
      .pipe(source('bundle.js'))
      .pipe(gulp.dest('public/js/'));
  }
});

/*
 |--------------------------------------------------------------------------
 | Compile LESS stylesheets.
 |--------------------------------------------------------------------------
 */
gulp.task('styles', function() {
  return gulp.src('app/stylesheets/main.less')
    .pipe(plumber())
    .pipe(less())
    .pipe(autoprefixer())
    .pipe(gulpif(production, cssmin()))
    .pipe(gulp.dest('public/css'));
});

gulp.task('watch', function() {
  gulp.watch('app/stylesheets/**/*.less', ['styles']);
});

gulp.task('default', ['styles', 'vendor', 'browserify-watch', 'watch']);
gulp.task('build', ['styles', 'vendor', 'browserify']);<|endoftext|>


<commit_before>'use strict';

var SERVER = {
        HOST: '127.0.0.1',
        PORT: 8080
    },
    PATH = {
        BUILD: './',
        SOURCE: './src/'
    };

var gulp = require('gulp'),
    concat = require('gulp-concat'),
    imagemin = require('gulp-imagemin'),
    inject = require('gulp-inject'),
    jshint = require('gulp-jshint'),
    minifyCSS = require('gulp-minify-css'),
    minifyHTML = require('gulp-minify-html'),
    prochtml = require('gulp-processhtml'),
    requirejs = require('requirejs'),
    rimraf = require('rimraf'),
    runSequence = require('run-sequence'),
    size = require('gulp-size'),
    stylish = require('jshint-stylish'),
    webserver = require('gulp-webserver');

gulp.task('lint', function() {
    return gulp.src(PATH.SOURCE + 'scripts/**/*.js')
        .pipe(jshint({
            // Enforcing options
            'bitwise': true,
            'camelcase': true,
            'curly': true,
            'eqeqeq': true,
            'immed': true,
            'indent': 4,
            'latedef': true,
            'newcap': true,
            'noarg': true,
            'nonbsp': true,
            'quotmark': 'single',
            'undef': true,
            'unused': true,
            'strict': true,
            'trailing': true,

            // Relaxing options
            'esnext': true,
            'smarttabs': true,

            // Environments
            'browser': true,
            'devel': true,
            'node': true,

            // Custom globals
            'globals': {
                'CONFIG': true,
                'define': true
            }
        }))
        .pipe(jshint.reporter(stylish));
});

gulp.task('requirejs', ['lint'], function() {
    requirejs.optimize({
        baseUrl: PATH.SOURCE + 'scripts/',
        out: PATH.BUILD + 'scripts/site.min.js',
        mainConfigFile: PATH.SOURCE + 'scripts/main.js',
        include: ['../vendor/requirejs/require.min.js', 'main'],
        insertRequire: ['main'],
        wrap: true,
        optimize: 'uglify2',
        preserveLicenseComments: false
    }, function() {
        return 0;
    }, function(err) {
        console.log(err);
        return 1;
    });
});

gulp.task('styles', function() {
    return gulp.src([
            PATH.SOURCE + 'styles/**/*.css',
            PATH.SOURCE + 'vendor/ngDialog/css/ngDialog.min.css',
            PATH.SOURCE + 'vendor/ngDialog/css/ngDialog-theme-default.min.css',
            PATH.SOURCE + 'fonts/**/*.css'
        ])
        .pipe(concat('site.min.css'))
        .pipe(minifyCSS())
        .pipe(gulp.dest(PATH.BUILD + 'styles/'));
});

gulp.task('images', function() {
    return gulp.src(PATH.SOURCE + 'media/images/**/*')
        .pipe(imagemin())
        .pipe(gulp.dest(PATH.BUILD + 'media/images/'));
});

gulp.task('html', function() {
    gulp.src(PATH.SOURCE + 'index.html')
        .pipe(gulp.dest(PATH.BUILD));

    gulp.src([
            PATH.SOURCE + 'partials/**/*.html',
            '!' + PATH.SOURCE + 'partials/views/projectList.html',
            '!' + PATH.SOURCE + 'partials/views/projectDetail.html',
        ])
        .pipe(minifyHTML())
        .pipe(gulp.dest(PATH.BUILD + 'partials/'));

    gulp.src(PATH.SOURCE + 'partials/views/projectList.html')
        .pipe(prochtml('projectList.html'))
        .pipe(minifyHTML())
        .pipe(gulp.dest(PATH.BUILD + 'partials/views/'));

    gulp.src(PATH.SOURCE + 'partials/views/projectDetail.html')
        .pipe(prochtml('projectDetail.html'))
        .pipe(minifyHTML())
        .pipe(gulp.dest(PATH.BUILD + 'partials/views/'));
});

gulp.task('copy', function() {
    gulp.src([
            PATH.SOURCE + 'fonts/fontello/font/*.eot',
            PATH.SOURCE + 'fonts/fontello/font/*.svg',
            PATH.SOURCE + 'fonts/fontello/font/*.ttf',
            PATH.SOURCE + 'fonts/fontello/font/*.woff'
        ])
        .pipe(gulp.dest(PATH.BUILD + 'font/'));
});

gulp.task('concat', function() {
    gulp.src([
            PATH.SOURCE + 'tasks/licence.js',
            PATH.BUILD + 'scripts/site.min.js'
        ])
        .pipe(concat('site.min.js'))
        .pipe(gulp.dest(PATH.BUILD + 'scripts/'));

    gulp.src([
            PATH.SOURCE + 'tasks/licence.css',
            PATH.BUILD + 'styles/site.min.css'
        ])
        .pipe(concat('site.min.css'))
        .pipe(gulp.dest(PATH.BUILD + 'styles/'));
});

gulp.task('inject-scripts', ['requirejs'], function() {
    return gulp.src(PATH.BUILD + 'index.html')
        .pipe(inject(gulp.src(PATH.BUILD + 'scripts/site.min.js'), {
            starttag: '<!-- inject:head:js -->',
            transform: function(filePath, file) {
                return '<script>' + file.contents.toString('utf8') + '</script>';
            }
        }))
        .pipe(gulp.dest(PATH.BUILD));
});

gulp.task('inject-styles', ['styles'], function() {
    return gulp.src(PATH.BUILD + 'index.html')
        .pipe(inject(gulp.src(PATH.BUILD + 'styles/site.min.css'), {
            starttag: '<!-- inject:head:css -->',
            transform: function(filePath, file) {
                return '<style>' + file.contents.toString('utf8') + '</style>';
            }
        }))
        .pipe(gulp.dest(PATH.BUILD));
});

gulp.task('clean', function() {
    rimraf.sync(PATH.BUILD + 'index.html', function() {});
    rimraf.sync(PATH.BUILD + 'fonts/', function() {});
    rimraf.sync(PATH.BUILD + 'media/', function() {});
    rimraf.sync(PATH.BUILD + 'partials/', function() {});
    rimraf.sync(PATH.BUILD + 'scripts/', function() {});
    rimraf.sync(PATH.BUILD + 'styles/', function() {});
});

gulp.task('size', function() {
    return gulp.src([
            PATH.BUILD + 'index.html',
            PATH.BUILD + 'fonts/**/*',
            PATH.BUILD + 'media/**/*',
            PATH.BUILD + 'partial/**/*',
            PATH.BUILD + 'scripts/**/*',
            PATH.BUILD + 'styles/**/*',
        ])
        .pipe(size({
            gzip: true,
            title: 'build -->'
        }));
});

gulp.task('webserver-dev', function() {
    gulp.src(PATH.SOURCE)
        .pipe(webserver({
            host: SERVER.HOST,
            port: SERVER.PORT,
            livereload: true
        }));
});

gulp.task('webserver', function() {
    gulp.src(PATH.BUILD)
        .pipe(webserver({
            host: SERVER.HOST,
            port: SERVER.PORT
        }));
});

gulp.task('build', function() {
    runSequence(
        'clean',
        ['html', 'copy', 'images'],
        'concat',
        'inject-scripts',
        'inject-styles',
        'size',
        'webserver'
    );
});
<commit_msg>Added post-build gulp task.<commit_after>'use strict';

var SERVER = {
        HOST: '127.0.0.1',
        PORT: 8080
    },
    PATH = {
        BUILD: './',
        SOURCE: './src/'
    };

var gulp = require('gulp'),
    concat = require('gulp-concat'),
    imagemin = require('gulp-imagemin'),
    inject = require('gulp-inject'),
    jshint = require('gulp-jshint'),
    minifyCSS = require('gulp-minify-css'),
    minifyHTML = require('gulp-minify-html'),
    prochtml = require('gulp-processhtml'),
    requirejs = require('requirejs'),
    rimraf = require('rimraf'),
    runSequence = require('run-sequence'),
    size = require('gulp-size'),
    stylish = require('jshint-stylish'),
    webserver = require('gulp-webserver');

gulp.task('lint', function() {
    return gulp.src(PATH.SOURCE + 'scripts/**/*.js')
        .pipe(jshint({
            // Enforcing options
            'bitwise': true,
            'camelcase': true,
            'curly': true,
            'eqeqeq': true,
            'immed': true,
            'indent': 4,
            'latedef': true,
            'newcap': true,
            'noarg': true,
            'nonbsp': true,
            'quotmark': 'single',
            'undef': true,
            'unused': true,
            'strict': true,
            'trailing': true,

            // Relaxing options
            'esnext': true,
            'smarttabs': true,

            // Environments
            'browser': true,
            'devel': true,
            'node': true,

            // Custom globals
            'globals': {
                'CONFIG': true,
                'define': true
            }
        }))
        .pipe(jshint.reporter(stylish));
});

gulp.task('requirejs', ['lint'], function() {
    requirejs.optimize({
        baseUrl: PATH.SOURCE + 'scripts/',
        out: PATH.BUILD + 'scripts/site.min.js',
        mainConfigFile: PATH.SOURCE + 'scripts/main.js',
        include: ['../vendor/requirejs/require.min.js', 'main'],
        insertRequire: ['main'],
        wrap: true,
        optimize: 'uglify2',
        preserveLicenseComments: false
    }, function() {
        return 0;
    }, function(err) {
        console.log(err);
        return 1;
    });
});

gulp.task('styles', function() {
    return gulp.src([
            PATH.SOURCE + 'styles/**/*.css',
            PATH.SOURCE + 'vendor/ngDialog/css/ngDialog.min.css',
            PATH.SOURCE + 'vendor/ngDialog/css/ngDialog-theme-default.min.css',
            PATH.SOURCE + 'fonts/**/*.css'
        ])
        .pipe(concat('site.min.css'))
        .pipe(minifyCSS())
        .pipe(gulp.dest(PATH.BUILD + 'styles/'));
});

gulp.task('images', function() {
    return gulp.src(PATH.SOURCE + 'media/images/**/*')
        .pipe(imagemin())
        .pipe(gulp.dest(PATH.BUILD + 'media/images/'));
});

gulp.task('html', function() {
    gulp.src(PATH.SOURCE + 'index.html')
        .pipe(gulp.dest(PATH.BUILD));

    gulp.src([
            PATH.SOURCE + 'partials/**/*.html',
            '!' + PATH.SOURCE + 'partials/views/projectList.html',
            '!' + PATH.SOURCE + 'partials/views/projectDetail.html',
        ])
        .pipe(minifyHTML())
        .pipe(gulp.dest(PATH.BUILD + 'partials/'));

    gulp.src(PATH.SOURCE + 'partials/views/projectList.html')
        .pipe(prochtml('projectList.html'))
        .pipe(minifyHTML())
        .pipe(gulp.dest(PATH.BUILD + 'partials/views/'));

    gulp.src(PATH.SOURCE + 'partials/views/projectDetail.html')
        .pipe(prochtml('projectDetail.html'))
        .pipe(minifyHTML())
        .pipe(gulp.dest(PATH.BUILD + 'partials/views/'));
});

gulp.task('copy', function() {
    gulp.src([
            PATH.SOURCE + 'fonts/fontello/font/*.eot',
            PATH.SOURCE + 'fonts/fontello/font/*.svg',
            PATH.SOURCE + 'fonts/fontello/font/*.ttf',
            PATH.SOURCE + 'fonts/fontello/font/*.woff'
        ])
        .pipe(gulp.dest(PATH.BUILD + 'font/'));
});

gulp.task('concat', function() {
    gulp.src([
            PATH.SOURCE + 'tasks/licence.js',
            PATH.BUILD + 'scripts/site.min.js'
        ])
        .pipe(concat('site.min.js'))
        .pipe(gulp.dest(PATH.BUILD + 'scripts/'));

    gulp.src([
            PATH.SOURCE + 'tasks/licence.css',
            PATH.BUILD + 'styles/site.min.css'
        ])
        .pipe(concat('site.min.css'))
        .pipe(gulp.dest(PATH.BUILD + 'styles/'));
});

gulp.task('inject-scripts', ['requirejs'], function() {
    return gulp.src(PATH.BUILD + 'index.html')
        .pipe(inject(gulp.src(PATH.BUILD + 'scripts/site.min.js'), {
            starttag: '<!-- inject:head:js -->',
            transform: function(filePath, file) {
                return '<script>' + file.contents.toString('utf8') + '</script>';
            }
        }))
        .pipe(gulp.dest(PATH.BUILD));
});

gulp.task('inject-styles', ['styles'], function() {
    return gulp.src(PATH.BUILD + 'index.html')
        .pipe(inject(gulp.src(PATH.BUILD + 'styles/site.min.css'), {
            starttag: '<!-- inject:head:css -->',
            transform: function(filePath, file) {
                return '<style>' + file.contents.toString('utf8') + '</style>';
            }
        }))
        .pipe(gulp.dest(PATH.BUILD));
});

gulp.task('clean', function() {
    rimraf.sync(PATH.BUILD + 'index.html', function() {});
    rimraf.sync(PATH.BUILD + 'fonts/', function() {});
    rimraf.sync(PATH.BUILD + 'media/', function() {});
    rimraf.sync(PATH.BUILD + 'partials/', function() {});
    //rimraf.sync(PATH.BUILD + 'scripts/', function() {});
    //rimraf.sync(PATH.BUILD + 'styles/', function() {});
});

gulp.task('post-build', function() {
    gulp.src(PATH.BUILD + 'index.html')
        .pipe(minifyHTML())
        .pipe(gulp.dest(PATH.BUILD));

    rimraf.sync(PATH.BUILD + 'scripts/', function() {});
    rimraf.sync(PATH.BUILD + 'styles/', function() {});
});

gulp.task('size', function() {
    return gulp.src([
            PATH.BUILD + 'index.html',
            PATH.BUILD + 'fonts/**/*',
            PATH.BUILD + 'media/**/*',
            PATH.BUILD + 'partial/**/*',
            //PATH.BUILD + 'scripts/**/*',
            //PATH.BUILD + 'styles/**/*',
        ])
        .pipe(size({
            gzip: true,
            title: 'build -->'
        }));
});

gulp.task('webserver-dev', function() {
    gulp.src(PATH.SOURCE)
        .pipe(webserver({
            host: SERVER.HOST,
            port: SERVER.PORT,
            livereload: true
        }));
});

gulp.task('webserver', function() {
    gulp.src(PATH.BUILD)
        .pipe(webserver({
            host: SERVER.HOST,
            port: SERVER.PORT
        }));
});

gulp.task('build', function() {
    runSequence(
        'clean',
        ['html', 'copy', 'images'],
        'concat',
        'inject-scripts',
        'inject-styles',
        'post-build',
        'size',
        'webserver'
    );
});
<|endoftext|>


<commit_before>/* -------------------------------------------------------------------------------------------------

Build Configuration
Contributors: Luan Gjokaj

-------------------------------------------------------------------------------------------------- */
'use strict';
var babel = require('gulp-babel');
var browserSync = require('browser-sync').create();
var cachebust = require('gulp-cache-bust');
var concat = require('gulp-concat');
var cssnano = require('cssnano');
var postcssPresetEnv = require('postcss-preset-env');
var del = require('del');
var fileinclude = require('gulp-file-include');
var gulp = require('gulp');
var gutil = require('gulp-util');
var htmlmin = require('gulp-htmlmin');
var imagemin = require('gulp-imagemin');
var modRewrite = require('connect-modrewrite');
var postcssImport = require('postcss-import');
var plumber = require('gulp-plumber');
var postcss = require('gulp-postcss');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
PostCSS Plugins
-------------------------------------------------------------------------------------------------- */
var pluginsDev = [
	postcssImport,
	postcssPresetEnv({
		stage: 3,
		features: {
			'nesting-rules': true,
		},
	}),
];
var pluginsProd = [
	postcssImport,
	postcssPresetEnv({
		stage: 3,
		features: {
			'nesting-rules': true,
		},
	}),
	cssnano({
		reduceIdents: false,
	}),
];
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
Header & Footer JavaScript Boundles
-------------------------------------------------------------------------------------------------- */
var headerJS = ['src/etc/analytics.js', 'node_modules/aos/dist/aos.js'];
var footerJS = ['node_modules/jquery/dist/jquery.js', 'src/assets/js/**'];
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
Development Tasks
-------------------------------------------------------------------------------------------------- */
gulp.task(
	'build-dev',
	[
		'cleanup',
		'style-dev',
		'copy-images',
		'copy-fonts',
		'header-scripts-dev',
		'footer-scripts-dev',
		'process-static-files-dev',
		'watch',
	],
	function() {
		browserSync.init({
			server: {
				baseDir: 'app',
			},
			middleware: [modRewrite(['^.([^\\.]+)$ /$1.html [L]'])],
		});
	},
);

gulp.task('default');

gulp.task('style-dev', function() {
	return gulp
		.src('src/assets/style/main.css')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(sourcemaps.init())
		.pipe(postcss(pluginsDev))
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('app/assets/css'))
		.pipe(browserSync.stream({ match: '**/*.css' }));
});

gulp.task('header-scripts-dev', function() {
	return gulp
		.src(headerJS)
		.pipe(plumber({ errorHandler: onError }))
		.pipe(sourcemaps.init())
		.pipe(concat('top.js'))
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('app/assets/js'));
});

gulp.task('footer-scripts-dev', function() {
	return gulp
		.src(footerJS)
		.pipe(plumber({ errorHandler: onError }))
		.pipe(sourcemaps.init())
		.pipe(
			babel({
				presets: ['env'],
			}),
		)
		.pipe(concat('bundle.js'))
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('app/assets/js'));
});

gulp.task('process-static-files-dev', function() {
	return gulp
		.src(['src/*.html'])
		.pipe(plumber({ errorHandler: onError }))
		.pipe(
			fileinclude({
				filters: {
					prefix: '@@',
					basepath: '@file',
				},
			}),
		)
		.pipe(
			cachebust({
				type: 'timestamp',
			}),
		)
		.pipe(gulp.dest('app'));
});

gulp.task('reload-js', ['footer-scripts-dev'], function(done) {
	browserSync.reload();
	done();
});

gulp.task('reload-images', ['copy-images'], function(done) {
	browserSync.reload();
	done();
});

gulp.task('reload-fonts', ['copy-fonts'], function(done) {
	browserSync.reload();
	done();
});

gulp.task('reload-files', ['process-static-files-dev'], function(done) {
	browserSync.reload();
	done();
});

gulp.task('watch', function() {
	gulp.watch(['src/assets/style/**/*.css'], ['style-dev']);
	gulp.watch(['src/assets/js/**'], ['reload-js']);
	gulp.watch(['src/assets/img/**'], ['reload-images']);
	gulp.watch(['src/assets/fonts/**'], ['reload-fonts']);
	gulp.watch(['src/*.html', 'src/includes/**'], ['reload-files']);
});
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
Production Tasks
-------------------------------------------------------------------------------------------------- */
gulp.task(
	'build-prod',
	[
		'cleanup',
		'style-prod',
		'copy-htaccess',
		'copy-images',
		'copy-fonts',
		'header-scripts-prod',
		'footer-scripts-prod',
		'process-static-files-prod',
	],
	function() {
		gutil.beep();
		gutil.log(filesGenerated);
		gutil.log(thankYou);
	},
);

gulp.task('style-prod', function() {
	return gulp
		.src('src/assets/style/main.css')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(postcss(pluginsProd))
		.pipe(gulp.dest('app/assets/css'));
});

gulp.task('copy-htaccess', function() {
	return gulp
		.src('src/etc/.htaccess')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(gulp.dest('app'));
});

gulp.task('header-scripts-prod', function() {
	return gulp
		.src(headerJS)
		.pipe(plumber({ errorHandler: onError }))
		.pipe(concat('top.js'))
		.pipe(uglify())
		.pipe(gulp.dest('app/assets/js'));
});

gulp.task('footer-scripts-prod', function() {
	return gulp
		.src(footerJS)
		.pipe(plumber({ errorHandler: onError }))
		.pipe(
			babel({
				presets: ['env'],
			}),
		)
		.pipe(concat('bundle.js'))
		.pipe(uglify())
		.pipe(gulp.dest('app/assets/js'));
});

gulp.task('process-static-files-prod', function() {
	return gulp
		.src(['src/*.html'])
		.pipe(plumber({ errorHandler: onError }))
		.pipe(
			fileinclude({
				filters: {
					prefix: '@@',
					basepath: '@file',
				},
			}),
		)
		.pipe(
			cachebust({
				type: 'timestamp',
			}),
		)
		.pipe(
			htmlmin({
				collapseWhitespace: true,
				ignoreCustomFragments: [/<%[\s\S]*?%>/, /<\?[=|php]?[\s\S]*?\?>/],
			}),
		)
		.pipe(gulp.dest('app'));
});
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
Shared Tasks
-------------------------------------------------------------------------------------------------- */
gulp.task('cleanup', function() {
	del.sync(['app/**']);
});

gulp.task('copy-images', function() {
	return gulp
		.src('src/assets/img/**')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(gulp.dest('app/assets/img'));
});

gulp.task('copy-fonts', function() {
	return gulp
		.src('src/assets/fonts/**')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(gulp.dest('app/assets/fonts'));
});

gulp.task('process-images', function() {
	return gulp
		.src('src/assets/img/**')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(
			imagemin([imagemin.svgo({ plugins: [{ removeViewBox: true }] })], {
				verbose: true,
			}),
		)
		.pipe(gulp.dest('app/assets/img'));
});
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
Utilitie Tasks
-------------------------------------------------------------------------------------------------- */
var swb = '\x1b[44m\x1b[1mStatic Web Build\x1b[0m';
var swbUrl = '\x1b[2m - https://staticbuild.website/\x1b[0m';
var thankYou = 'Thank you for using the ' + swb + swbUrl;
var errorMsg = '\x1b[41mError\x1b[0m';
var filesGenerated =
	'Your distribution files are generated in: \x1b[1m' + __dirname + '/app/' + '\x1b[0m - ✅';

var onError = function(err) {
	gutil.beep();
	console.log(swb + ' - ' + errorMsg + ' ' + err.toString());
	this.emit('end');
};
/* -------------------------------------------------------------------------------------------------
End of all Tasks
-------------------------------------------------------------------------------------------------- */
<commit_msg>Update<commit_after>/* -------------------------------------------------------------------------------------------------

Build Configuration
Contributors: Luan Gjokaj

-------------------------------------------------------------------------------------------------- */
'use strict';
var babel = require('gulp-babel');
var browserSync = require('browser-sync').create();
var cachebust = require('gulp-cache-bust');
var concat = require('gulp-concat');
var cssnano = require('cssnano');
var postcssPresetEnv = require('postcss-preset-env');
var del = require('del');
var fileinclude = require('gulp-file-include');
var gulp = require('gulp');
var gutil = require('gulp-util');
var htmlmin = require('gulp-htmlmin');
var imagemin = require('gulp-imagemin');
var modRewrite = require('connect-modrewrite');
var postcssImport = require('postcss-import');
var plumber = require('gulp-plumber');
var postcss = require('gulp-postcss');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
PostCSS Plugins
-------------------------------------------------------------------------------------------------- */
var pluginsDev = [
	postcssImport,
	postcssPresetEnv({
		stage: 3,
		features: {
			'nesting-rules': true,
			'color-mod-function': true,
		},
	}),
];
var pluginsProd = [
	postcssImport,
	postcssPresetEnv({
		stage: 3,
		features: {
			'nesting-rules': true,
			'color-mod-function': true,
		},
	}),
	cssnano({
		reduceIdents: false,
	}),
];
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
Header & Footer JavaScript Boundles
-------------------------------------------------------------------------------------------------- */
var headerJS = ['src/etc/analytics.js', 'node_modules/aos/dist/aos.js'];
var footerJS = ['node_modules/jquery/dist/jquery.js', 'src/assets/js/**'];
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
Development Tasks
-------------------------------------------------------------------------------------------------- */
gulp.task(
	'build-dev',
	[
		'cleanup',
		'style-dev',
		'copy-images',
		'copy-fonts',
		'header-scripts-dev',
		'footer-scripts-dev',
		'process-static-files-dev',
		'watch',
	],
	function() {
		browserSync.init({
			server: {
				baseDir: 'app',
			},
			middleware: [modRewrite(['^.([^\\.]+)$ /$1.html [L]'])],
		});
	},
);

gulp.task('default');

gulp.task('style-dev', function() {
	return gulp
		.src('src/assets/style/main.css')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(sourcemaps.init())
		.pipe(postcss(pluginsDev))
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('app/assets/css'))
		.pipe(browserSync.stream({ match: '**/*.css' }));
});

gulp.task('header-scripts-dev', function() {
	return gulp
		.src(headerJS)
		.pipe(plumber({ errorHandler: onError }))
		.pipe(sourcemaps.init())
		.pipe(concat('top.js'))
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('app/assets/js'));
});

gulp.task('footer-scripts-dev', function() {
	return gulp
		.src(footerJS)
		.pipe(plumber({ errorHandler: onError }))
		.pipe(sourcemaps.init())
		.pipe(
			babel({
				presets: ['env'],
			}),
		)
		.pipe(concat('bundle.js'))
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest('app/assets/js'));
});

gulp.task('process-static-files-dev', function() {
	return gulp
		.src(['src/*.html'])
		.pipe(plumber({ errorHandler: onError }))
		.pipe(
			fileinclude({
				filters: {
					prefix: '@@',
					basepath: '@file',
				},
			}),
		)
		.pipe(
			cachebust({
				type: 'timestamp',
			}),
		)
		.pipe(gulp.dest('app'));
});

gulp.task('reload-js', ['footer-scripts-dev'], function(done) {
	browserSync.reload();
	done();
});

gulp.task('reload-images', ['copy-images'], function(done) {
	browserSync.reload();
	done();
});

gulp.task('reload-fonts', ['copy-fonts'], function(done) {
	browserSync.reload();
	done();
});

gulp.task('reload-files', ['process-static-files-dev'], function(done) {
	browserSync.reload();
	done();
});

gulp.task('watch', function() {
	gulp.watch(['src/assets/style/**/*.css'], ['style-dev']);
	gulp.watch(['src/assets/js/**'], ['reload-js']);
	gulp.watch(['src/assets/img/**'], ['reload-images']);
	gulp.watch(['src/assets/fonts/**'], ['reload-fonts']);
	gulp.watch(['src/*.html', 'src/includes/**'], ['reload-files']);
});
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
Production Tasks
-------------------------------------------------------------------------------------------------- */
gulp.task(
	'build-prod',
	[
		'cleanup',
		'style-prod',
		'copy-htaccess',
		'copy-images',
		'copy-fonts',
		'header-scripts-prod',
		'footer-scripts-prod',
		'process-static-files-prod',
	],
	function() {
		gutil.beep();
		gutil.log(filesGenerated);
		gutil.log(thankYou);
	},
);

gulp.task('style-prod', function() {
	return gulp
		.src('src/assets/style/main.css')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(postcss(pluginsProd))
		.pipe(gulp.dest('app/assets/css'));
});

gulp.task('copy-htaccess', function() {
	return gulp
		.src('src/etc/.htaccess')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(gulp.dest('app'));
});

gulp.task('header-scripts-prod', function() {
	return gulp
		.src(headerJS)
		.pipe(plumber({ errorHandler: onError }))
		.pipe(concat('top.js'))
		.pipe(uglify())
		.pipe(gulp.dest('app/assets/js'));
});

gulp.task('footer-scripts-prod', function() {
	return gulp
		.src(footerJS)
		.pipe(plumber({ errorHandler: onError }))
		.pipe(
			babel({
				presets: ['env'],
			}),
		)
		.pipe(concat('bundle.js'))
		.pipe(uglify())
		.pipe(gulp.dest('app/assets/js'));
});

gulp.task('process-static-files-prod', function() {
	return gulp
		.src(['src/*.html'])
		.pipe(plumber({ errorHandler: onError }))
		.pipe(
			fileinclude({
				filters: {
					prefix: '@@',
					basepath: '@file',
				},
			}),
		)
		.pipe(
			cachebust({
				type: 'timestamp',
			}),
		)
		.pipe(
			htmlmin({
				collapseWhitespace: true,
				ignoreCustomFragments: [/<%[\s\S]*?%>/, /<\?[=|php]?[\s\S]*?\?>/],
			}),
		)
		.pipe(gulp.dest('app'));
});
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
Shared Tasks
-------------------------------------------------------------------------------------------------- */
gulp.task('cleanup', function() {
	del.sync(['app/**']);
});

gulp.task('copy-images', function() {
	return gulp
		.src('src/assets/img/**')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(gulp.dest('app/assets/img'));
});

gulp.task('copy-fonts', function() {
	return gulp
		.src('src/assets/fonts/**')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(gulp.dest('app/assets/fonts'));
});

gulp.task('process-images', function() {
	return gulp
		.src('src/assets/img/**')
		.pipe(plumber({ errorHandler: onError }))
		.pipe(
			imagemin([imagemin.svgo({ plugins: [{ removeViewBox: true }] })], {
				verbose: true,
			}),
		)
		.pipe(gulp.dest('app/assets/img'));
});
//--------------------------------------------------------------------------------------------------
/* -------------------------------------------------------------------------------------------------
Utilitie Tasks
-------------------------------------------------------------------------------------------------- */
var swb = '\x1b[44m\x1b[1mStatic Web Build\x1b[0m';
var swbUrl = '\x1b[2m - https://staticbuild.website/\x1b[0m';
var thankYou = 'Thank you for using the ' + swb + swbUrl;
var errorMsg = '\x1b[41mError\x1b[0m';
var filesGenerated =
	'Your distribution files are generated in: \x1b[1m' + __dirname + '/app/' + '\x1b[0m - ✅';

var onError = function(err) {
	gutil.beep();
	console.log(swb + ' - ' + errorMsg + ' ' + err.toString());
	this.emit('end');
};
/* -------------------------------------------------------------------------------------------------
End of all Tasks
-------------------------------------------------------------------------------------------------- */
<|endoftext|>


<commit_before>var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var browserSync = require('browser-sync').create();
var clean = require('gulp-clean');
var cssmin = require('gulp-cssmin');
var flatten = require('gulp-flatten');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var htmlmin = require('gulp-htmlmin');

var node_modules_path = './node_modules';
var paths = {
	'node': './node_modules',
	'assets': './assets'
}

// remove files in the public folder
gulp.task('clean', function(){
	return gulp.src('./public/**/**/*', {read: false})
									.pipe(clean());
});

gulp.task('serve', function(){
	browserSync.init({
		server: {
			baseDir: './public'
		}
	});

	gulp.watch(paths.assets + '/pages/*' , ['pages']);
	gulp.watch(paths.assets + '/images/*' , ['images']);
	gulp.watch(paths.assets + '/styles/**/*.scss',['styles']);
	gulp.watch(paths.assets + '/data/*', ['data']);
	gulp.watch(paths.assets + '/scripts/*.js',['scripts']);

  gulp.watch([paths.assets + '/data/*', paths.assets + '/styles/app.scss',
    				'public/*.html', paths.assets + '/scripts/**/*.js']).on('change', browserSync.reload);
});

gulp.task('pages', function(){
	return gulp.src([paths.assets + '/pages/*'])
					.pipe(htmlmin({collapseWhitespace: true}))
					.pipe(gulp.dest('./public'), { base: '.' });

});

// compiles styles with foundation base styles
gulp.task('styles', function(){
	gulp.src(paths.assets + '/styles/app.scss')
	.pipe(sass())
	.pipe(cssmin())
	.pipe(gulp.dest('./public/css'), { base: '.'});
});

gulp.task('images', function(){
	return gulp.src([
			paths.assets + '/images/**/*'
		])
		.pipe(flatten())
		.pipe(gulp.dest('./public/assets/'));
});

gulp.task('documents', function(){
	return gulp.src([
		paths.assets + '/documents/*'
	]).pipe(gulp.dest('./public/assets'));
})

gulp.task('data', function(){
	return gulp.src([
		paths.assets + '/data/*'
	]).pipe(gulp.dest('./public/data'));
})

gulp.task('scripts', function(){

	// index page
	gulp.src(paths.assets + '/scripts/index.js')
	  .pipe(rename('index.min.js'))
		// .pipe(uglify())
		.pipe(gulp.dest('./public/js'));

	// artwork page
	// need foundation, the modal, and jquery
	gulp.src([
		paths.node + '/masonry-layout/dist/masonry.pkgd.js',
		paths.assets + '/scripts/artApp.js'])
	.pipe(concat('artApp.js'))
	.pipe(gulp.dest('./public/js'));

});

gulp.task('default', ['pages', 'images', 'styles', 'data', 'scripts', 'documents', 'serve']);

gulp.task('build', ['pages', 'images', 'styles', 'data', 'scripts', 'documents']);
<commit_msg>Add cname gulp task<commit_after>var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var browserSync = require('browser-sync').create();
var clean = require('gulp-clean');
var cssmin = require('gulp-cssmin');
var flatten = require('gulp-flatten');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var htmlmin = require('gulp-htmlmin');

var node_modules_path = './node_modules';
var paths = {
	'node': './node_modules',
	'assets': './assets'
}

// remove files in the public folder
gulp.task('clean', function(){
	return gulp.src('./public/**/**/*', {read: false})
									.pipe(clean());
});

gulp.task('serve', function(){
	browserSync.init({
		server: {
			baseDir: './public'
		}
	});

	gulp.watch(paths.assets + '/pages/*' , ['pages']);
	gulp.watch(paths.assets + '/images/*' , ['images']);
	gulp.watch(paths.assets + '/styles/**/*.scss',['styles']);
	gulp.watch(paths.assets + '/data/*', ['data']);
	gulp.watch(paths.assets + '/scripts/*.js',['scripts']);

  gulp.watch([paths.assets + '/data/*', paths.assets + '/styles/app.scss',
    				'public/*.html', paths.assets + '/scripts/**/*.js']).on('change', browserSync.reload);
});

gulp.task('pages', function(){
	return gulp.src([paths.assets + '/pages/*'])
					.pipe(htmlmin({collapseWhitespace: true}))
					.pipe(gulp.dest('./public'), { base: '.' });

});

// compiles styles with foundation base styles
gulp.task('styles', function(){
	gulp.src(paths.assets + '/styles/app.scss')
	.pipe(sass())
	.pipe(cssmin())
	.pipe(gulp.dest('./public/css'), { base: '.'});
});

gulp.task('images', function(){
	return gulp.src([
			paths.assets + '/images/**/*'
		])
		.pipe(flatten())
		.pipe(gulp.dest('./public/assets/'));
});

gulp.task('documents', function(){
	return gulp.src([
		paths.assets + '/documents/*'
	]).pipe(gulp.dest('./public/assets'));
})

gulp.task('data', function(){
	return gulp.src([
		paths.assets + '/data/*'
	]).pipe(gulp.dest('./public/data'));
})

gulp.task('scripts', function(){

	// index page
	gulp.src(paths.assets + '/scripts/index.js')
	  .pipe(rename('index.min.js'))
		// .pipe(uglify())
		.pipe(gulp.dest('./public/js'));

	// artwork page
	// need foundation, the modal, and jquery
	gulp.src([
		paths.node + '/masonry-layout/dist/masonry.pkgd.js',
		paths.assets + '/scripts/artApp.js'])
	.pipe(concat('artApp.js'))
	.pipe(gulp.dest('./public/js'));

});

gulp.task('cname', function() {
	gulp.src('./CNAME').pipe(gulp.dest('./public'));
});

gulp.task('default', ['pages', 'images', 'styles', 'data', 'scripts', 'documents', 'serve']);

gulp.task('build', ['pages', 'images', 'styles', 'data', 'scripts', 'documents', 'cname']);
<|endoftext|>


<commit_before>'use strict';

var fs = require('fs');
var through = require('through');

var gulp = require("gulp");
var ts = require("gulp-typescript");
var tsProject = ts.createProject("tsconfig.json");

var browserify = require("browserify");
var source = require('vinyl-source-stream');
var tsify = require("tsify");

var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');
var buffer = require('vinyl-buffer');

/////////////////////////
// Transforms

// The elliptic package.json is only used for its version
var ellipticPackage = require('elliptic/package.json');
ellipticPackage = JSON.stringify({ version: ellipticPackage.version });

var version = require('./package.json').version;

var undef = "module.exports = undefined;";
var empty = "module.exports = {};";

// We already have a random Uint8Array browser/node safe source
// @TODO: Use path construction instead of ../..
var brorand = "var randomBytes = require('../../src.ts/utils').randomBytes; module.exports = function(length) { return randomBytes(length); };";

// setImmediate is installed globally by our src.browser/shims.ts, loaded from src.ts/index.ts
var process = "module.exports = { };";
var timers = "module.exports = { setImmediate: global.setImmediate }; ";

var transforms = {
//    'ethers.js/package.json': JSON.stringify({ version: version }),

    // Remove the precomputed secp256k1 points
    "elliptic/lib/elliptic/precomputed/secp256k1.js": undef,

    // Remove curves we don't care about
    "elliptic/curve/edwards.js": empty,
    "elliptic/curve/mont.js": empty,
    "elliptic/lib/elliptic/eddsa/.*": empty,

    // We only use the version from this JSON package
    "elliptic/package.json" : ellipticPackage,

    // Remove RIPEMD160 and unneeded hashing algorithms
    "hash.js/lib/hash/ripemd.js": "module.exports = {ripemd160: null}",
    "hash.js/lib/hash/sha/1.js": empty,
    "hash.js/lib/hash/sha/224.js": empty,
    "hash.js/lib/hash/sha/384.js": empty,

    // Swap out borland for the random bytes we already have
    "brorand/index.js": brorand,

    // Used by sha3 if it exists; (so make it no exist)
    "process/browser.js": process,
    "timers-browserify/main.js": timers,

    // Browser doesn't automatically get wordlists (individual files avaialble)
    "src.ts/wordlists/index.ts": "module.exports = { }",
};

function transformFile(path) {
    for (var pattern in transforms) {
        if (path.match(new RegExp('/' + pattern + '$'))) {
            return transforms[pattern];
        }
    }
    return null;
}

function padding(length) {
    let pad = '';
    while (pad.length < length) { pad += ' '; }
    return pad;
}

/**
 *  Browser Library
 *
 *  Source: src.ts/index.ts src.ts/{contracts,providers,utils,wallet}/*.ts
 *  Target: dist/ethers{.min,}.js
 *
 *  See the above transform tables which maps regular expressions to
 *  replacement source for largely libraries we only require parts of.
 *
 */
function transform(path, options) {
    var data = '';

    return through(function(chunk) {
        data += chunk;
    }, function () {
        var transformed = transformFile(path);
        var shortPath = path;
        if (shortPath.substring(0, __dirname.length) == __dirname) {
            shortPath = shortPath.substring(__dirname.length);
        }
        var size = fs.readFileSync(path).length;
        if (transformed != null) {
            console.log('Transformed:', shortPath, padding(70 - shortPath.length), size, padding(6 - String(size).length), '=>', transformed.length);
            data = transformed;
        } else if (shortPath === '/src.ts/wordlists/wordlist.ts') {
            data += '\n\nexportWordlist = true;'
        } else {
            console.log('Preserved:  ', shortPath, padding(70 - shortPath.length), size);
        }
        this.queue(data);
        this.queue(null);
    });
}

/**
 *  Browser Wordlist files
 *
 *  Source: src.ts/wordlists/lang-*.ts.
 *  Target: dist/wordlist-*.js
 *
 *  Since all of the functions these wordlists use is already
 *  available from the global ethers library, we use this to
 *  target the global ethers functions directly, rather than
 *  re-include them.
 *
 */
function transformBip39(path, options) {
    var data = '';

    return through(function(chunk) {
        data += chunk;
    }, function () {
        var shortPath = path;
        if (shortPath.substring(0, __dirname.length) == __dirname) {
            shortPath = shortPath.substring(__dirname.length);
        }

        // Word list files...
        if (shortPath.match(/^\/src\.ts\/wordlists\//)) {
            // If it is the wordlist class, register should export the wordlist
            if (shortPath === '/src.ts/wordlists/wordlist.ts') {
                data += '\n\nexportWordlist = true;'
            }
            shortPath = '/';
        }

        switch (shortPath) {
            case '/src.ts/utils/errors.ts':
                data = "module.exports = global.ethers.utils.errors";
                break;
            case '/src.ts/utils/bytes.ts':
            case '/src.ts/utils/properties.ts':
            case '/src.ts/utils/utf8.ts':
                data = "module.exports = global.ethers.utils";
                break;
            case '/': break;
            default:
                throw new Error('unhandled file: ' + shortPath);
        }

        this.queue(data);
        this.queue(null);
    });
}

function taskBundle(name, options) {

  gulp.task(name, function () {

    var result = browserify({
        basedir: '.',
        debug: false,
        entries: [ './src.ts/' ],
        cache: {},
        packageCache: {},
        standalone: "ethers",
        transform: [ [ transform, { global: true } ] ],
    })
    .plugin(tsify)
    .bundle()
    .pipe(source(options.filename))

    if (options.minify) {
        result = result.pipe(buffer())
        .pipe(sourcemaps.init({ loadMaps: true }))
        .pipe(uglify())
        .pipe(sourcemaps.write('./'))
    }

    result = result.pipe(gulp.dest("dist"));

    return result;
  });
}

// Creates dist/ethers.js
taskBundle("default", { filename: "ethers.js", minify: false });

// Creates dist/ethers.min.js
taskBundle("minified", { filename: "ethers.min.js", minify: true });

// Crearte a single definition file and its map as dist/ethers.d.ts[.map]
gulp.task("temp-types", function() {
    return gulp.src(['./src.ts/index.ts', './src.ts/**/*.ts'])
    .pipe(ts({
        declaration: true,
        esModuleInterop: true,
        moduleResolution: "node",
//        outFile: 'ethers.js',
        lib: [ "es2015", "es5", "dom" ],
        module: "commonjs",
//        rootDir: "./src.ts",
        target: "es5",
    }))
    .dts
//    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest(".tmp"))
});

/**
 *  Browser Friendly BIP39 Wordlists
 *
 *  source: src.ts/wordlist/lang-*.ts
 *  target: dist/wordlist-*.js
 *
 */
function taskLang(locale) {
    gulp.task("bip39-" + locale, function() {
        return browserify({
            basedir: '.',
            debug: false,
            entries: [ 'src.ts/wordlists/lang-' + locale + ".ts" ],
            cache: {},
            packageCache: {},
            transform: [ [ transformBip39, { global: true } ] ],
        })
        .plugin(tsify)
        .bundle()
        .pipe(source("wordlist-" + locale + ".js"))
        .pipe(buffer())
        .pipe(uglify())
        .pipe(gulp.dest("dist"));
    });
}

taskLang("it");
taskLang("ja");
taskLang("ko");
taskLang("zh");

// Package up all the test cases into tests/dist/tests.json
gulp.task("tests", function() {

    // Create a mock-fs module that can load our gzipped test cases
    var data = {};

    fs.readdirSync('tests/tests').forEach(function(filename) {
        if (!filename.match(/\.json\.gz$/)) { return; }
        filename = 'tests/tests/' + filename;
        data['/' + filename] = fs.readFileSync(filename).toString('base64');
    });

    fs.readdirSync('tests/tests/easyseed-bip39').forEach(function(filename) {
        if (!filename.match(/\.json$/)) { return; }
        filename = 'tests/tests/easyseed-bip39/' + filename;
        data['/' + filename] = fs.readFileSync(filename).toString('base64');
    });

    fs.writeFileSync('./tests/dist/tests.json', JSON.stringify(data));

    return browserify({
        basedir: './',
        debug: false,
        entries: [ "./tests/browser.js" ],
        cache: {},
        packageCache: {},
        standalone: "tests"
    })
    .bundle()
    .pipe(source("tests.js"))
    .pipe(gulp.dest("tests/dist/"));
});

<commit_msg>Added wordlists to faux-fs for phantomjs testing.<commit_after>'use strict';

var fs = require('fs');
var through = require('through');

var gulp = require("gulp");
var ts = require("gulp-typescript");
var tsProject = ts.createProject("tsconfig.json");

var browserify = require("browserify");
var source = require('vinyl-source-stream');
var tsify = require("tsify");

var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');
var buffer = require('vinyl-buffer');

/////////////////////////
// Transforms

// The elliptic package.json is only used for its version
var ellipticPackage = require('elliptic/package.json');
ellipticPackage = JSON.stringify({ version: ellipticPackage.version });

var version = require('./package.json').version;

var undef = "module.exports = undefined;";
var empty = "module.exports = {};";

// We already have a random Uint8Array browser/node safe source
// @TODO: Use path construction instead of ../..
var brorand = "var randomBytes = require('../../src.ts/utils').randomBytes; module.exports = function(length) { return randomBytes(length); };";

// setImmediate is installed globally by our src.browser/shims.ts, loaded from src.ts/index.ts
var process = "module.exports = { };";
var timers = "module.exports = { setImmediate: global.setImmediate }; ";

var transforms = {
//    'ethers.js/package.json': JSON.stringify({ version: version }),

    // Remove the precomputed secp256k1 points
    "elliptic/lib/elliptic/precomputed/secp256k1.js": undef,

    // Remove curves we don't care about
    "elliptic/curve/edwards.js": empty,
    "elliptic/curve/mont.js": empty,
    "elliptic/lib/elliptic/eddsa/.*": empty,

    // We only use the version from this JSON package
    "elliptic/package.json" : ellipticPackage,

    // Remove RIPEMD160 and unneeded hashing algorithms
    "hash.js/lib/hash/ripemd.js": "module.exports = {ripemd160: null}",
    "hash.js/lib/hash/sha/1.js": empty,
    "hash.js/lib/hash/sha/224.js": empty,
    "hash.js/lib/hash/sha/384.js": empty,

    // Swap out borland for the random bytes we already have
    "brorand/index.js": brorand,

    // Used by sha3 if it exists; (so make it no exist)
    "process/browser.js": process,
    "timers-browserify/main.js": timers,

    // Browser doesn't automatically get wordlists (individual files avaialble)
    "src.ts/wordlists/index.ts": "module.exports = { en: require('./lang-en').langEn }",
};

function transformFile(path) {
    for (var pattern in transforms) {
        if (path.match(new RegExp('/' + pattern + '$'))) {
            return transforms[pattern];
        }
    }
    return null;
}

function padding(length) {
    let pad = '';
    while (pad.length < length) { pad += ' '; }
    return pad;
}

/**
 *  Browser Library
 *
 *  Source: src.ts/index.ts src.ts/{contracts,providers,utils,wallet}/*.ts
 *  Target: dist/ethers{.min,}.js
 *
 *  See the above transform tables which maps regular expressions to
 *  replacement source for largely libraries we only require parts of.
 *
 */
function transform(path, options) {
    var data = '';

    return through(function(chunk) {
        data += chunk;
    }, function () {
        var transformed = transformFile(path);
        var shortPath = path;
        if (shortPath.substring(0, __dirname.length) == __dirname) {
            shortPath = shortPath.substring(__dirname.length);
        }
        var size = fs.readFileSync(path).length;
        if (transformed != null) {
            console.log('Transformed:', shortPath, padding(70 - shortPath.length), size, padding(6 - String(size).length), '=>', transformed.length);
            data = transformed;
        } else if (shortPath === '/src.ts/wordlists/wordlist.ts') {
            data += '\n\nexportWordlist = true;'
        } else {
            console.log('Preserved:  ', shortPath, padding(70 - shortPath.length), size);
        }
        this.queue(data);
        this.queue(null);
    });
}

/**
 *  Browser Wordlist files
 *
 *  Source: src.ts/wordlists/lang-*.ts.
 *  Target: dist/wordlist-*.js
 *
 *  Since all of the functions these wordlists use is already
 *  available from the global ethers library, we use this to
 *  target the global ethers functions directly, rather than
 *  re-include them.
 *
 */
function transformBip39(path, options) {
    var data = '';

    return through(function(chunk) {
        data += chunk;
    }, function () {
        var shortPath = path;
        if (shortPath.substring(0, __dirname.length) == __dirname) {
            shortPath = shortPath.substring(__dirname.length);
        }

        // Word list files...
        if (shortPath.match(/^\/src\.ts\/wordlists\//)) {
            // If it is the wordlist class, register should export the wordlist
            if (shortPath === '/src.ts/wordlists/wordlist.ts') {
                data += '\n\nexportWordlist = true;'
            }
            shortPath = '/';
        }

        switch (shortPath) {
            case '/src.ts/utils/errors.ts':
                data = "module.exports = global.ethers.utils.errors";
                break;
            case '/src.ts/utils/bytes.ts':
            case '/src.ts/utils/hash.ts':
            case '/src.ts/utils/properties.ts':
            case '/src.ts/utils/utf8.ts':
                data = "module.exports = global.ethers.utils";
                break;
            case '/': break;
            default:
                throw new Error('unhandled file: ' + shortPath);
        }

        this.queue(data);
        this.queue(null);
    });
}

function taskBundle(name, options) {

  gulp.task(name, function () {

    var result = browserify({
        basedir: '.',
        debug: false,
        entries: [ './src.ts/' ],
        cache: {},
        packageCache: {},
        standalone: "ethers",
        transform: [ [ transform, { global: true } ] ],
    })
    .plugin(tsify)
    .bundle()
    .pipe(source(options.filename))

    if (options.minify) {
        result = result.pipe(buffer())
        .pipe(sourcemaps.init({ loadMaps: true }))
        .pipe(uglify())
        .pipe(sourcemaps.write('./'))
    }

    result = result.pipe(gulp.dest("dist"));

    return result;
  });
}

// Creates dist/ethers.js
taskBundle("default", { filename: "ethers.js", minify: false });

// Creates dist/ethers.min.js
taskBundle("minified", { filename: "ethers.min.js", minify: true });

// Crearte a single definition file and its map as dist/ethers.d.ts[.map]
gulp.task("temp-types", function() {
    return gulp.src(['./src.ts/index.ts', './src.ts/**/*.ts'])
    .pipe(ts({
        declaration: true,
        esModuleInterop: true,
        moduleResolution: "node",
//        outFile: 'ethers.js',
        lib: [ "es2015", "es5", "dom" ],
        module: "commonjs",
//        rootDir: "./src.ts",
        target: "es5",
    }))
    .dts
//    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest(".tmp"))
});

/**
 *  Browser Friendly BIP39 Wordlists
 *
 *  source: src.ts/wordlist/lang-*.ts
 *  target: dist/wordlist-*.js
 *
 */
function taskLang(locale) {
    gulp.task("bip39-" + locale, function() {
        return browserify({
            basedir: '.',
            debug: false,
            entries: [ 'src.ts/wordlists/lang-' + locale + ".ts" ],
            cache: {},
            packageCache: {},
            transform: [ [ transformBip39, { global: true } ] ],
        })
        .plugin(tsify)
        .bundle()
        .pipe(source("wordlist-" + locale + ".js"))
        .pipe(buffer())
        .pipe(uglify())
        .pipe(gulp.dest("dist"));
    });
}

taskLang("it");
taskLang("ja");
taskLang("ko");
taskLang("zh");

// Package up all the test cases into tests/dist/tests.json
gulp.task("tests", function() {

    // Create a mock-fs module that can load our gzipped test cases
    var data = {};

    fs.readdirSync('tests/tests').forEach(function(filename) {
        if (!filename.match(/\.json\.gz$/)) { return; }
        filename = 'tests/tests/' + filename;
        data['/' + filename] = fs.readFileSync(filename).toString('base64');
    });

    fs.readdirSync('tests/tests/easyseed-bip39').forEach(function(filename) {
        if (!filename.match(/\.json$/)) { return; }
        filename = 'tests/tests/easyseed-bip39/' + filename;
        data['/' + filename] = fs.readFileSync(filename).toString('base64');
    });

    fs.readdirSync('tests/wordlist-generation').forEach(function(filename) {
        if (!filename.match(/\.txt$/)) { return; }
        filename = 'tests/wordlist-generation/' + filename;
        data['/' + filename] = fs.readFileSync(filename).toString('base64');
    });

    fs.writeFileSync('./tests/dist/tests.json', JSON.stringify(data));

    return browserify({
        basedir: './',
        debug: false,
        entries: [ "./tests/browser.js" ],
        cache: {},
        packageCache: {},
        standalone: "tests"
    })
    .bundle()
    .pipe(source("tests.js"))
    .pipe(gulp.dest("tests/dist/"));
});

<|endoftext|>


<commit_before>var gulp = require('gulp'),
    fs = require("fs"),
    concat = require('gulp-concat'),
    postcss = require('gulp-postcss'),
    replace = require('gulp-replace'),
    cssnext = require("gulp-cssnext"),
    mixins = require('postcss-mixins'),
    imagemin = require('gulp-imagemin'),
    pngquant = require('imagemin-pngquant'),
    notify = require('gulp-notify'),
    autogrid = require('autogrid')

// Grid editor
  gulp.task('grid', function() {
    var css = autogrid({
      columns: 12,
      gutter: '20px',
      container: '1700px'
    });
    fs.writeFileSync('src/css/grid.css', css);
  });

// compile CSS
  gulp.task('styles', function() {
    return gulp.src('src/css/style.css')
      .pipe(postcss([
        require('postcss-import')({path: ['bower_components'], from: 'src/css/style.css'}),
        require('postcss-mixins')({
          mixins: require('postcss-neat')()
        }),
        require('postcss-simple-vars'),
        require('postcss-nested').
        require('autoprefixer-core')({ browsers: ['last 2 versions', '> 2%'] })

      ]))
      .pipe(cssnext())
      .pipe(gulp.dest('build/css/'))
      .pipe(notify({ message: 'Styles task complete' }))
  });

// compile HTML
  gulp.task('minify', function() {
    return gulp.src('src/**/*.php')
      .pipe(gulp.dest('build'))
      .pipe(notify({ message: 'HTML compile finished' }))
  });

// Images
  gulp.task('images', function() {
    return gulp.src('src/img/**/*')
      .pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
      .pipe(gulp.dest('build/img'))
      .pipe(notify({ message: 'Images task complete' }));
  });

// Compile scripts
  gulp.task('scripts', function() {
    return gulp.src([
      'bower_components/**/*.min.js',
      'src/js/scripts.js'])
      .pipe(concat('scripts.min.js'))
      .pipe(gulp.dest('build/js'))
      .pipe(notify({ message: 'Javascript compiled' }));
  });

// Replace
  gulp.task('replace', ['minify'], function(){

  });
// Watch
  gulp.task('watch', function() {

    // Watch .scss files
    gulp.watch('src/css/**/*.css', ['styles']);

    //Watch .js files
    gulp.watch('src/js/**/*.js', ['scripts']);

    // Watch image files
    gulp.watch('src/img/**/*', ['images']);

    // Watch php files
    gulp.watch('src/*.php', ['replace']);

    // Create LiveReload server
    // livereload.listen();

    // Watch any files in build/, reload on change
    // gulp.watch(['/']).on('change', livereload.changed);

  });
 // Build project
  gulp.task('build', [
    'styles',
    'minify',
    'scripts',
    'images'
  ]);<commit_msg>Created development branch<commit_after>var gulp = require('gulp'),
    fs = require("fs"),
    concat = require('gulp-concat'),
    postcss = require('gulp-postcss'),
    replace = require('gulp-replace'),
    cssnext = require("gulp-cssnext"),
    mixins = require('postcss-mixins'),
    imagemin = require('gulp-imagemin'),
    pngquant = require('imagemin-pngquant'),
    notify = require('gulp-notify'),
    autogrid = require('autogrid'),
    include = require('postcss-include')

// Grid editor
  gulp.task('grid', function() {
    var css = autogrid({
      columns: 12,
      gutter: '20px',
      container: '1700px'
    });
    fs.writeFileSync('src/css/grid.css', css);
  });

// compile CSS
  gulp.task('styles', function() {
    return gulp.src('src/css/style.css')
      .pipe(postcss([
        require('postcss-import')({path: ['bower_components'], from: 'src/css/style.css'}),
        require('postcss-mixins'),
        require('postcss-simple-vars'),
        require('postcss-nested'),
        require('postcss-include'),
        require('autoprefixer-core')({ browsers: ['last 2 versions', '> 2%'] })

      ]))
      .pipe(cssnext())
      // .pipe(include({ css: 'src/css/style.css' }))
      .pipe(gulp.dest('build/css/'))
      .pipe(notify({ message: 'Styles task complete' }))
  });

// compile HTML
  gulp.task('minify', function() {
    return gulp.src('src/**/*.php')
      .pipe(gulp.dest('build'))
      .pipe(notify({ message: 'HTML compile finished' }))
  });

// Images
  gulp.task('images', function() {
    return gulp.src('src/img/**/*')
      .pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
      .pipe(gulp.dest('build/img'))
      .pipe(notify({ message: 'Images task complete' }));
  });

// Compile scripts
  gulp.task('scripts', function() {
    return gulp.src([
      'bower_components/**/*.min.js',
      'src/js/scripts.js'])
      .pipe(concat('scripts.min.js'))
      .pipe(gulp.dest('build/js'))
      .pipe(notify({ message: 'Javascript compiled' }));
  });

// Replace
  gulp.task('replace', ['minify'], function(){

  });
// Watch
  gulp.task('watch', function() {

    // Watch .scss files
    gulp.watch('src/css/**/*.css', ['styles']);

    //Watch .js files
    gulp.watch('src/js/**/*.js', ['scripts']);

    // Watch image files
    gulp.watch('src/img/**/*', ['images']);

    // Watch php files
    gulp.watch('src/*.php', ['replace']);

    // Create LiveReload server
    // livereload.listen();

    // Watch any files in build/, reload on change
    // gulp.watch(['/']).on('change', livereload.changed);

  });
 // Build project
  gulp.task('build', [
    'styles',
    'minify',
    'scripts',
    'images'
  ]);<|endoftext|>


<commit_before>var gulp 					= require('gulp'),
		browserSync 	= require('browser-sync').create(),
		sass 					= require('gulp-sass'),
		autoprefixer 	= require('gulp-autoprefixer'),
		uglify 				= require('gulp-uglify'),
		imagemin			= require('gulp-imagemin'),
		concat 				= require('gulp-concat'),
		minifyHTML 		= require('gulp-minify-html');

gulp.task('browser-sync', function(){
	browserSync.init({
		server: {
			baseDir: "./public"
		}
	});
});

gulp.task('sass', function(){
	gulp.src('source/sass/**/*.scss')
		.pipe(sass({
			includePaths: ['scss'],
			onError: browserSync.notify
		}))
		.pipe(autoprefixer({
			browsers: ['last 12 versions'],
			cascade: true
		}))
		.pipe(sass(({outputStyle: 'expanded'})))
		.pipe(gulp.dest('./public/app/css'))
		.pipe(browserSync.stream());
});

gulp.task('js', function(){
	gulp.src('source/js/**/*.js')
		.pipe(concat('main.js'))
		.pipe(uglify())
		.pipe(gulp.dest('./public/app/js'))
		.pipe(browserSync.stream());
});

gulp.task('imagemin', function(){
	gulp.src('source/img/**/*')
		.pipe(imagemin({
			progressive: true,
			interlaced: true,
      svgoPlugins: [{removeViewBox: false}],
		}))
		.pipe(gulp.dest('./public/app/img'))
});

gulp.task('fonts', function(){
	gulp.src('source/fonts/**/*')
		.pipe(gulp.dest('./public/app/fonts'));
});

gulp.task('minify-html', function(){
	gulp.src('source/*.html')
		.pipe(minifyHTML({empty: true}))
		.pipe(gulp.dest('./public'))
		.pipe(browserSync.stream());
});

gulp.task('watch', function() {
	gulp.watch('source/sass/**/*.scss', ['sass']);
	gulp.watch('source/js/**/*.js', ['js']);
	gulp.watch('source/img/**/*', ['imagemin']);
	gulp.watch('source/fonts/**/*', ['fonts']);
	gulp.watch('source/*.html', ['minify-html']);
});

gulp.task('default', ['browser-sync', 'watch', 'imagemin', 'fonts']);<commit_msg>Add plugin gh-pages<commit_after>var gulp 					= require('gulp'),
		browserSync 	= require('browser-sync').create(),
		sass 					= require('gulp-sass'),
		autoprefixer 	= require('gulp-autoprefixer'),
		uglify 				= require('gulp-uglify'),
		imagemin			= require('gulp-imagemin'),
		concat 				= require('gulp-concat'),
		minifyHTML 		= require('gulp-minify-html')
		ghPages				= require('gulp-gh-pages');

gulp.task('browser-sync', function(){
	browserSync.init({
		server: {
			baseDir: "./public"
		}
	});
});

gulp.task('sass', function(){
	gulp.src('source/sass/**/*.scss')
		.pipe(sass({
			includePaths: ['scss'],
			onError: browserSync.notify
		}))
		.pipe(autoprefixer({
			browsers: ['last 12 versions'],
			cascade: true
		}))
		.pipe(sass(({outputStyle: 'expanded'})))
		.pipe(gulp.dest('./public/app/css'))
		.pipe(browserSync.stream());
});

gulp.task('js', function(){
	gulp.src('source/js/**/*.js')
		.pipe(concat('main.js'))
		.pipe(uglify())
		.pipe(gulp.dest('./public/app/js'))
		.pipe(browserSync.stream());
});

gulp.task('imagemin', function(){
	gulp.src('source/img/**/*')
		.pipe(imagemin({
			progressive: true,
			interlaced: true,
      svgoPlugins: [{removeViewBox: false}],
		}))
		.pipe(gulp.dest('./public/app/img'))
});

gulp.task('fonts', function(){
	gulp.src('source/fonts/**/*')
		.pipe(gulp.dest('./public/app/fonts'));
});

gulp.task('minify-html', function(){
	gulp.src('source/*.html')
		.pipe(minifyHTML({empty: true}))
		.pipe(gulp.dest('./public'))
		.pipe(browserSync.stream());
});

gulp.task('deploy', function() {
  return gulp.src('./public/**/*')
    .pipe(ghPages());
});

gulp.task('watch', function() {
	gulp.watch('source/sass/**/*.scss', ['sass']);
	gulp.watch('source/js/**/*.js', ['js']);
	gulp.watch('source/img/**/*', ['imagemin']);
	gulp.watch('source/fonts/**/*', ['fonts']);
	gulp.watch('source/*.html', ['minify-html']);
});

gulp.task('default', ['browser-sync', 'watch', 'imagemin', 'fonts']);<|endoftext|>


<commit_before>// Packages
const { src, dest, series, parallel, watch } = require("gulp");
const autoprefixer = require("autoprefixer");
const browserSync = require("browser-sync").create();
const babel = require("gulp-babel");
const del = require("del");
const fs = require("fs");
const cleanCSS = require("gulp-clean-css");
const concat = require("gulp-concat");
const config = require("./config");
const data = require("gulp-data");
const gulpif = require("gulp-if");
const header = require("gulp-header");
const imagemin = require("gulp-imagemin");
const pkg = require("./package.json");
const plumber = require("gulp-plumber");
const postcss = require("gulp-postcss");
const rename = require("gulp-rename");
const sass = require("gulp-sass")(require("node-sass"));
const sourcemaps = require("gulp-sourcemaps");
const spritesmith = require("gulp.spritesmith");
const terser = require("gulp-terser");
const twig = require("gulp-twig");
const zip = require("gulp-zip");

// File Banner
const banner = [
  "/*!",
  " * <%= pkg.name %> - <%= pkg.description %>",
  " * @version v<%= pkg.version %>",
  " * @link <%= pkg.homepage %>",
  " * @license <%= pkg.license %>",
  " */",
  "",
].join("\n");

// Get Timestamp
const getTimestamp = () => {
  let date = new Date();
  let year = date.getFullYear().toString();
  let month = ("0" + (date.getMonth() + 1)).slice(-2);
  let day = ("0" + date.getDate()).slice(-2);
  let hour = ("0" + date.getHours().toString()).slice(-2);
  let minute = ("0" + date.getMinutes().toString()).slice(-2);
  let second = ("0" + date.getSeconds().toString()).slice(-2);
  return year + month + day + hour + minute + second;
};

// Archive pre-existing content from output folders
const archiveDist = (cb) => {
  src(config.archive.input)
    .pipe(zip(pkg.name + "_v" + pkg.version + "-build_" + getTimestamp() + ".zip"))
    .pipe(dest(config.archive.output));
  return cb();
};

// Remove pre-existing content from output folders
const cleanDist = (cb) => {
  del.sync(config.clean);
  return cb();
};

// Optimise GIF, JPEG, PNG and SVG images
const buildImages = () => {
  return src(config.images.input)
    .pipe(plumber())
    .pipe(
      imagemin({
        interlaced: true,
        progressive: true,
        optimizationLevel: 5,
        svgoPlugins: [
          {
            removeViewBox: true,
          },
        ],
      })
    )
    .pipe(dest(config.images.output));
};

// Concanate & minify JavaScript files
const buildScripts = () => {
  return src(config.scripts.input)
    .pipe(plumber())
    .pipe(gulpif(process.env.NODE_ENV === "development", sourcemaps.init()))
    .pipe(
      babel({
        presets: ["@babel/env"],
      })
    )
    .pipe(concat("app.js"))
    .pipe(header(banner, { pkg: pkg }))
    .pipe(dest(config.scripts.output))
    .pipe(
      terser({
        keep_fnames: true,
        mangle: false,
      })
    )
    .pipe(
      rename({
        suffix: ".min",
      })
    )
    .pipe(gulpif(process.env.NODE_ENV === "development", sourcemaps.write(".")))
    .pipe(dest(config.scripts.output));
};

// Convert a set of images into a spritesheet and CSS variables
const buildSprites = (cb) => {
  const spriteData = gulp
    .src(config.sprites.input)
    .pipe(plumber())
    .pipe(
      spritesmith({
        imgName: "s.png",
        cssName: "_sprites.scss",
        cssFormat: "scss",
        cssTemplate: "src/sprites/scss.template.handlebars",
        imgPath: "../images/s.png",
        padding: 3,
        imgOpts: {
          quality: 100,
        },
      })
    );

  spriteData.img.pipe(dest(config.sprites.output));
  spriteData.css.pipe(dest(config.sprites.output));

  return cb();
};

// Compile, autoprefix & minify SASS files
const buildStyles = () => {
  return src(config.styles.input)
    .pipe(plumber())
    .pipe(gulpif(process.env.NODE_ENV === "development", sourcemaps.init()))
    .pipe(
      sass({
        outputStyle: "expanded",
      })
    )
    .pipe(postcss([autoprefixer()]))
    .pipe(header(banner, { pkg: pkg }))
    .pipe(dest(config.styles.output))
    .pipe(
      cleanCSS({
        level: {
          1: {
            specialComments: 0,
          },
        },
      })
    )
    .pipe(header(banner, { pkg: pkg }))
    .pipe(
      rename({
        suffix: ".min",
      })
    )
    .pipe(gulpif(process.env.NODE_ENV === "development", sourcemaps.write(".")))
    .pipe(dest(config.styles.output));
};

// Compile Twig files to HTML
const buildTemplates = () => {
  return src(config.templates.input)
    .pipe(plumber())
    .pipe(
      data((file) => {
        return JSON.parse(fs.readFileSync("website.json"));
      })
    )
    .pipe(twig())
    .pipe(dest(config.templates.output));
};

// Watch for changes to the source directory
const serveDist = (cb) => {
  browserSync.init({
    server: {
      baseDir: config.server.root,
    },
  });
  cb();
};

// Reload the browser when files change
const reloadBrowser = (cb) => {
  browserSync.reload();
  cb();
};

// Watch all file changes
const watchSource = () => {
  watch(config.images.watch, series(buildImages, reloadBrowser));
  watch(config.scripts.watch, series(buildScripts, reloadBrowser));
  watch(config.styles.watch, series(buildStyles, reloadBrowser));
  watch(config.templates.watch, series(buildTemplates, reloadBrowser));
};

// Archive task
exports.archive = archiveDist;

// Clean task
exports.clean = cleanDist;

// Sprites task
exports.sprites = buildSprites;

// Build task
exports.build = series(parallel(buildScripts, buildStyles, buildTemplates), buildImages);

// Watch Task
exports.watch = watchSource;

// Default task
exports.default = series(exports.build, serveDist, watchSource);
<commit_msg>Update gulpfile.js<commit_after>// Packages
const { src, dest, series, parallel, watch } = require("gulp");
const autoprefixer = require("autoprefixer");
const browserSync = require("browser-sync").create();
const babel = require("gulp-babel");
const del = require("del");
const fs = require("fs");
const cleanCSS = require("gulp-clean-css");
const concat = require("gulp-concat");
const config = require("./config");
const data = require("gulp-data");
const gulpif = require("gulp-if");
const header = require("gulp-header");
const imagemin = require("gulp-imagemin");
const pkg = require("./package.json");
const plumber = require("gulp-plumber");
const postcss = require("gulp-postcss");
const rename = require("gulp-rename");
const sass = require("gulp-sass")(require("sass"));
const sourcemaps = require("gulp-sourcemaps");
const spritesmith = require("gulp.spritesmith");
const terser = require("gulp-terser");
const twig = require("gulp-twig");
const zip = require("gulp-zip");

// File Banner
const banner = [
  "/*!",
  " * <%= pkg.name %> - <%= pkg.description %>",
  " * @version v<%= pkg.version %>",
  " * @link <%= pkg.homepage %>",
  " * @license <%= pkg.license %>",
  " */",
  "",
].join("\n");

// Get Timestamp
const getTimestamp = () => {
  let date = new Date();
  let year = date.getFullYear().toString();
  let month = ("0" + (date.getMonth() + 1)).slice(-2);
  let day = ("0" + date.getDate()).slice(-2);
  let hour = ("0" + date.getHours().toString()).slice(-2);
  let minute = ("0" + date.getMinutes().toString()).slice(-2);
  let second = ("0" + date.getSeconds().toString()).slice(-2);
  return year + month + day + hour + minute + second;
};

// Archive pre-existing content from output folders
const archiveDist = (cb) => {
  src(config.archive.input)
    .pipe(zip(pkg.name + "_v" + pkg.version + "-build_" + getTimestamp() + ".zip"))
    .pipe(dest(config.archive.output));
  return cb();
};

// Remove pre-existing content from output folders
const cleanDist = (cb) => {
  del.sync(config.clean);
  return cb();
};

// Optimise GIF, JPEG, PNG and SVG images
const buildImages = () => {
  return src(config.images.input)
    .pipe(plumber())
    .pipe(
      imagemin({
        interlaced: true,
        progressive: true,
        optimizationLevel: 5,
        svgoPlugins: [
          {
            removeViewBox: true,
          },
        ],
      })
    )
    .pipe(dest(config.images.output));
};

// Concanate & minify JavaScript files
const buildScripts = () => {
  return src(config.scripts.input)
    .pipe(plumber())
    .pipe(gulpif(process.env.NODE_ENV === "development", sourcemaps.init()))
    .pipe(
      babel({
        presets: ["@babel/env"],
      })
    )
    .pipe(concat("app.js"))
    .pipe(header(banner, { pkg: pkg }))
    .pipe(dest(config.scripts.output))
    .pipe(
      terser({
        keep_fnames: true,
        mangle: false,
      })
    )
    .pipe(
      rename({
        suffix: ".min",
      })
    )
    .pipe(gulpif(process.env.NODE_ENV === "development", sourcemaps.write(".")))
    .pipe(dest(config.scripts.output));
};

// Convert a set of images into a spritesheet and CSS variables
const buildSprites = (cb) => {
  const spriteData = gulp
    .src(config.sprites.input)
    .pipe(plumber())
    .pipe(
      spritesmith({
        imgName: "s.png",
        cssName: "_sprites.scss",
        cssFormat: "scss",
        cssTemplate: "src/sprites/scss.template.handlebars",
        imgPath: "../images/s.png",
        padding: 3,
        imgOpts: {
          quality: 100,
        },
      })
    );

  spriteData.img.pipe(dest(config.sprites.output));
  spriteData.css.pipe(dest(config.sprites.output));

  return cb();
};

// Compile, autoprefix & minify SASS files
const buildStyles = () => {
  return src(config.styles.input)
    .pipe(plumber())
    .pipe(gulpif(process.env.NODE_ENV === "development", sourcemaps.init()))
    .pipe(
      sass({
        outputStyle: "expanded",
      })
    )
    .pipe(postcss([autoprefixer()]))
    .pipe(header(banner, { pkg: pkg }))
    .pipe(dest(config.styles.output))
    .pipe(
      cleanCSS({
        level: {
          1: {
            specialComments: 0,
          },
        },
      })
    )
    .pipe(header(banner, { pkg: pkg }))
    .pipe(
      rename({
        suffix: ".min",
      })
    )
    .pipe(gulpif(process.env.NODE_ENV === "development", sourcemaps.write(".")))
    .pipe(dest(config.styles.output));
};

// Compile Twig files to HTML
const buildTemplates = () => {
  return src(config.templates.input)
    .pipe(plumber())
    .pipe(
      data((file) => {
        return JSON.parse(fs.readFileSync("website.json"));
      })
    )
    .pipe(twig())
    .pipe(dest(config.templates.output));
};

// Watch for changes to the source directory
const serveDist = (cb) => {
  browserSync.init({
    server: {
      baseDir: config.server.root,
    },
  });
  cb();
};

// Reload the browser when files change
const reloadBrowser = (cb) => {
  browserSync.reload();
  cb();
};

// Watch all file changes
const watchSource = () => {
  watch(config.images.watch, series(buildImages, reloadBrowser));
  watch(config.scripts.watch, series(buildScripts, reloadBrowser));
  watch(config.styles.watch, series(buildStyles, reloadBrowser));
  watch(config.templates.watch, series(buildTemplates, reloadBrowser));
};

// Archive task
exports.archive = archiveDist;

// Clean task
exports.clean = cleanDist;

// Sprites task
exports.sprites = buildSprites;

// Build task
exports.build = series(parallel(buildScripts, buildStyles, buildTemplates), buildImages);

// Watch Task
exports.watch = watchSource;

// Default task
exports.default = series(exports.build, serveDist, watchSource);
<|endoftext|>


<commit_before>var gulp = require('gulp'),
    chug = require('gulp-chug'),
    http = require('http'),
    fs = require('fs');

gulp.task('spec', function(cb) {
    http.get({
        hostname: process.env.API_HOST || 'services.ci.reachmail.net',
        path: '/spec',
        headers: { accept: 'application/json' }
    },
    function(response) {
        response.pipe(fs.createWriteStream("./spec.json"));
        cb();
    });
});

gulp.task('ci', ['spec'], function() {
    return gulp.src('./*/gulpfile.js')
        .pipe(chug({ tasks: ['ci'].concat(process.argv.slice(2)) }));
});

gulp.task('deploy', ['spec'], function() {
    return gulp.src('./*/gulpfile.js')
        .pipe(chug({ tasks: ['deploy'].concat(process.argv.slice(2)) }));
});<commit_msg>Migrated to CLI params for the .NET wrapper build.<commit_after>var gulp = require('gulp'),
    chug = require('gulp-chug'),
    http = require('http'),
    fs = require('fs');

gulp.task('spec', function(cb) {
    http.get({
        hostname: process.env.API_HOST || 'services.ci.reachmail.net',
        path: '/spec',
        headers: { accept: 'application/json' }
    },
    function(response) {
        response.pipe(fs.createWriteStream("./spec.json"));
        cb();
    });
});

gulp.task('ci', ['spec'], function() {
    return gulp.src('./*/gulpfile.js')
        .pipe(chug({ tasks: ['ci'].concat(process.argv.slice(3)) }));
});

gulp.task('deploy', ['spec'], function() {
    return gulp.src('./*/gulpfile.js')
        .pipe(chug({ tasks: ['deploy'].concat(process.argv.slice(3)) }));
});<|endoftext|>


<commit_before>var gulp = require('gulp'),
	mocha = require('gulp-mocha'),
	jshint = require('gulp-jshint'),
	git = require('gulp-git');

gulp.task('mocha', function () {
	var mochaRun = mocha({
			reporter: 'nyan',
			ui: 'tdd'
		});

	return gulp
		.src('test/**/*.js')
		.pipe(mochaRun);
});

gulp.task('integration', function () {
	var mochaRun = mocha({
			reporter: 'nyan',
			ui: 'bdd'
		});

	return gulp
		.src('integration-tests/sentinaught-runner.js')
		.pipe(mochaRun);
});

gulp.task('jshint', function(){
	return gulp
		.src(['lib/**/*.js', 'test/**/*.js'])
		.pipe(jshint())
		.pipe(jshint.reporter('jshint-stylish'));
});

gulp.task('test', ['jshint', 'mocha', 'integration']);

gulp.task('push', ['test'], function(){
	var commitMessage = gulp.env.message || 'refactoring Yo!';
	console.log('Tests passed! Pushing code...');
	return gulp
		.src('./.')
		.pipe(git.add())
		.pipe(git.commit(commitMessage))
		.pipe(git.push());
});

gulp.task('default', function(){
	gulp.run('push');
});<commit_msg>changing gulp file<commit_after>var gulp = require('gulp'),
	mocha = require('gulp-mocha'),
	jshint = require('gulp-jshint'),
	git = require('gulp-git');

gulp.task('mocha', function () {
	var mochaRun = mocha({
			reporter: 'nyan',
			ui: 'tdd'
		});

	return gulp
		.src('test/**/*.js')
		.pipe(mochaRun);
});

gulp.task('integration', function () {
	var mochaRun = mocha({
			reporter: 'nyan',
			ui: 'bdd'
		});

	return gulp
		.src('integration-tests/sentinaught-runner.js')
		.pipe(mochaRun);
});

gulp.task('jshint', function(){
	return gulp
		.src(['lib/**/*.js', 'test/**/*.js'])
		.pipe(jshint())
		.pipe(jshint.reporter('jshint-stylish'));
});

gulp.task('test', ['jshint', 'mocha', 'integration']);

gulp.task('push', ['test'], function(){
	var commitMessage = gulp.env.m || 'refactoring Yo!';
	console.log('Tests passed! Pushing code...');
	return gulp
		.src('./.')
		.pipe(git.add())
		.pipe(git.commit(commitMessage))
		.pipe(git.push());
});

gulp.task('default', function(){
	gulp.run('push');
});<|endoftext|>


<commit_before>var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var uglify = require('gulp-uglify');
var cleanCSS = require('gulp-clean-css');
var imagemin = require('gulp-imagemin');
var fileInclude = require('gulp-file-include');
var concat = require('gulp-concat');

// **UIKit** scripts to concatenate and minify
var UIKitScripts = ['src/uikit/js/uikit.js', 'src/uikit/js/components/slideshow.js'];

// **Other** scripts to concatenate and minify
var scripts = ['src/js/main.js'];

gulp.task('sass', function() {
    return gulp.src('src/sass/main.scss')
        .pipe(sass())
        .pipe(autoprefixer({
            browsers: ['last 3 versions']
        }))
        .pipe(cleanCSS())
        .pipe(gulp.dest('build/css'));
});

gulp.task('uk-scripts', function() {
    return gulp.src(UIKitScripts)
        .pipe(concat('uikit.min.js'))
        .pipe(gulp.dest('build/js'))
        .pipe(uglify())
        .pipe(gulp.dest('build/js'));
});

gulp.task('scripts', function() {
    return gulp.src(scripts)
        .pipe(concat('main.min.js'))
        .pipe(gulp.dest('build/js'))
        .pipe(uglify())
        .pipe(gulp.dest('build/js'));
});

gulp.task('html', function() {
    return gulp.src(['src/index.html'])
        .pipe(fileInclude({
            prefix: '@@',
            basepath: '@file'
        }))
        .pipe(gulp.dest('build'));
});

gulp.task('default', ['sass', 'uk-scripts', 'scripts', 'html'], function() {
    gulp.watch('src/sass/*.scss', ['sass']);
    gulp.watch('src/js/*.js', ['scripts']);
    gulp.watch(['src/index.html', 'src/partials/*.html'], ['html']);
    gulp.src('src/img/*')
        .pipe(imagemin())
        .pipe(gulp.dest('build/img'));
});
<commit_msg>Add task for image compression<commit_after>var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var uglify = require('gulp-uglify');
var cleanCSS = require('gulp-clean-css');
var imagemin = require('gulp-imagemin');
var fileInclude = require('gulp-file-include');
var concat = require('gulp-concat');

// **UIKit** scripts to concatenate and minify
var UIKitScripts = ['src/uikit/js/uikit.js', 'src/uikit/js/components/slideshow.js'];

// **Other** scripts to concatenate and minify
var scripts = ['src/js/main.js'];

gulp.task('sass', function() {
    return gulp.src('src/sass/main.scss')
        .pipe(sass())
        .pipe(autoprefixer({
            browsers: ['last 3 versions']
        }))
        .pipe(cleanCSS())
        .pipe(gulp.dest('build/css'));
});

gulp.task('uk-scripts', function() {
    return gulp.src(UIKitScripts)
        .pipe(concat('uikit.min.js'))
        .pipe(gulp.dest('build/js'))
        .pipe(uglify())
        .pipe(gulp.dest('build/js'));
});

gulp.task('scripts', function() {
    return gulp.src(scripts)
        .pipe(concat('main.min.js'))
        .pipe(gulp.dest('build/js'))
        .pipe(uglify())
        .pipe(gulp.dest('build/js'));
});

gulp.task('html', function() {
    return gulp.src(['src/index.html'])
        .pipe(fileInclude({
            prefix: '@@',
            basepath: '@file'
        }))
        .pipe(gulp.dest('build'));
});

gulp.task('img', function() {
    return gulp.src('src/img/*')
        .pipe(imagemin())
        .pipe(gulp.dest('build/img'));
});

gulp.task('default', ['sass', 'uk-scripts', 'scripts', 'html', 'img'], function() {
    gulp.watch('src/sass/*.scss', ['sass']);
    gulp.watch('src/js/*.js', ['scripts']);
    gulp.watch(['src/index.html', 'src/partials/*.html'], ['html']);
});
<|endoftext|>