diff --git a/gulpfile.js b/gulpfile.js index c1b04c1..aacfe24 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -166,14 +166,14 @@ gulp.task( 'styles', function( callback ){ gulpSequence( 'sass', 'minifycss' )( // gulp browser-sync // Starts browser-sync task for starting the server. gulp.task( 'browser-sync', function() { - browserSync.init(cfg.browserSyncWatchFiles, cfg.browserSyncOptions); -}); + browserSync.init( cfg.browserSyncWatchFiles, cfg.browserSyncOptions ); +} ); // Run: // gulp watch-bs // Starts watcher with browser-sync. Browser-sync reloads page automatically on your browser -gulp.task( 'watch-bs', ['browser-sync', 'watch', 'scripts'], function () { }); +gulp.task( 'watch-bs', ['browser-sync', 'watch', 'scripts'], function () { } ); // Run: @@ -189,19 +189,19 @@ gulp.task( 'scripts', function() { paths.dev + '/js/skip-link-focus-fix.js' ]; - gulp.src(scripts) - .pipe(concat('theme.min.js')) - .pipe(uglify()) - .pipe(gulp.dest(paths.js)); + gulp.src( scripts ) + .pipe( concat( 'theme.min.js' ) ) + .pipe( uglify() ) + .pipe( gulp.dest(paths.js) ); - gulp.src(scripts) - .pipe(concat('theme.js')) - .pipe(gulp.dest(paths.js)); + gulp.src( scripts ) + .pipe( concat( 'theme.js' ) ) + .pipe( gulp.dest( paths.js ) ); }); // Deleting any file inside the /src folder -gulp.task( 'clean-source', function () { - return del(['src/**/*']); +gulp.task( 'clean-source', function() { + return del( ['src/**/*'] ); }); // Run: @@ -215,62 +215,62 @@ gulp.task( 'copy-assets', function() { // Copy all JS files - var stream = gulp.src(paths.node + 'bootstrap/dist/js/**/*.js') - .pipe(gulp.dest(paths.dev + '/js/bootstrap4')); + var stream = gulp.src( paths.node + 'bootstrap/dist/js/**/*.js' ) + .pipe( gulp.dest( paths.dev + '/js/bootstrap4' ) ); // Copy all Bootstrap SCSS files - gulp.src(paths.node + 'bootstrap/scss/**/*.scss') - .pipe(gulp.dest(paths.dev + '/sass/bootstrap4')); + gulp.src( paths.node + 'bootstrap/scss/**/*.scss' ) + .pipe( gulp.dest( paths.dev + '/sass/bootstrap4' ) ); ////////////////// End Bootstrap 4 Assets ///////////////////////// // Copy all Font Awesome Fonts - gulp.src(paths.node + 'font-awesome/fonts/**/*.{ttf,woff,woff2,eot,svg}') - .pipe(gulp.dest('./fonts')); + gulp.src( paths.node + 'font-awesome/fonts/**/*.{ttf,woff,woff2,eot,svg}' ) + .pipe( gulp.dest( './fonts') ); // Copy all Font Awesome SCSS files - gulp.src(paths.node + 'font-awesome/scss/*.scss') - .pipe(gulp.dest(paths.dev + '/sass/fontawesome')); + gulp.src( paths.node + 'font-awesome/scss/*.scss' ) + .pipe( gulp.dest( paths.dev + '/sass/fontawesome' ) ); // _s SCSS files - gulp.src(paths.node + 'undescores-for-npm/sass/media/*.scss') - .pipe(gulp.dest(paths.dev + '/sass/underscores')); + gulp.src( paths.node + 'undescores-for-npm/sass/media/*.scss' ) + .pipe( gulp.dest( paths.dev + '/sass/underscores' ) ); // _s JS files into /src/js - gulp.src(paths.node + 'undescores-for-npm/js/skip-link-focus-fix.js') - .pipe(gulp.dest(paths.dev + '/js')); + gulp.src( paths.node + 'undescores-for-npm/js/skip-link-focus-fix.js' ) + .pipe( gulp.dest( paths.dev + '/js' ) ); // _s JS files into /js - gulp.src(paths.node + 'undescores-for-npm/js/skip-link-focus-fix.js') - .pipe(gulp.dest(paths.js + paths.vendor)); + gulp.src( paths.node + 'undescores-for-npm/js/skip-link-focus-fix.js' ) + .pipe( gulp.dest( paths.js + paths.vendor ) ); // Copy Popper JS files - gulp.src(paths.node + 'popper.js/dist/umd/popper.min.js') - .pipe(gulp.dest(paths.js + paths.vendor)); - gulp.src(paths.node + 'popper.js/dist/umd/popper.js') - .pipe(gulp.dest(paths.js + paths.vendor)); + gulp.src( paths.node + 'popper.js/dist/umd/popper.min.js' ) + .pipe( gulp.dest( paths.js + paths.vendor ) ); + gulp.src( paths.node + 'popper.js/dist/umd/popper.js' ) + .pipe( gulp.dest( paths.js + paths.vendor ) ); return stream; }); // Deleting the files distributed by the copy-assets task gulp.task( 'clean-vendor-assets', function () { - return del([paths.dev+'/js/bootstrap4/**', paths.dev+'/sass/bootstrap4/**', './fonts/*wesome*.{ttf,woff,woff2,eot,svg}', paths.dev+'/sass/fontawesome/**', paths.dev+'/sass/underscores/**', paths.dev+'/js/skip-link-focus-fix.js', paths.js+'/**/skip-link-focus-fix.js', paths.js+'/**/popper.min.js', paths.js+'/**/popper.js', (paths.vendor!==''?(paths.js+paths.vendor+'/**'):'')]); + return del( [paths.dev+'/js/bootstrap4/**', paths.dev+'/sass/bootstrap4/**', './fonts/*wesome*.{ttf,woff,woff2,eot,svg}', paths.dev+'/sass/fontawesome/**', paths.dev+'/sass/underscores/**', paths.dev+'/js/skip-link-focus-fix.js', paths.js+'/**/skip-link-focus-fix.js', paths.js+'/**/popper.min.js', paths.js+'/**/popper.js', ( paths.vendor!==''?( paths.js+paths.vendor+'/**' ):'' )]); }); // Run // gulp dist // Copies the files to the /dist folder for distribution as simple theme gulp.task( 'dist', ['clean-dist'], function() { - return gulp.src(['**/*', '!'+paths.bower, '!'+paths.bower+'/**', '!'+paths.node, '!'+paths.node+'/**', '!'+paths.dev, '!'+paths.dev+'/**', '!'+paths.dist, '!'+paths.dist+'/**', '!'+paths.distprod, '!'+paths.distprod+'/**', '!'+paths.sass, '!'+paths.sass+'/**', '!readme.txt', '!readme.md', '!package.json', '!package-lock.json', '!gulpfile.js', '!gulpconfig.json', '!CHANGELOG.md', '!.travis.yml', '!jshintignore', '!codesniffer.ruleset.xml', '*'], {'buffer': false}) - .pipe(replace('/js/jquery.slim.min.js', '/js'+paths.vendor+'/jquery.slim.min.js', {'skipBinary': true})) - .pipe(replace('/js/popper.min.js', '/js'+paths.vendor+'/popper.min.js', {'skipBinary': true})) - .pipe(replace('/js/skip-link-focus-fix.js', '/js'+paths.vendor+'/skip-link-focus-fix.js', {'skipBinary': true})) - .pipe(gulp.dest(paths.dist)); + return gulp.src( ['**/*', '!'+paths.bower, '!'+paths.bower+'/**', '!'+paths.node, '!'+paths.node+'/**', '!'+paths.dev, '!'+paths.dev+'/**', '!'+paths.dist, '!'+paths.dist+'/**', '!'+paths.distprod, '!'+paths.distprod+'/**', '!'+paths.sass, '!'+paths.sass+'/**', '!readme.txt', '!readme.md', '!package.json', '!package-lock.json', '!gulpfile.js', '!gulpconfig.json', '!CHANGELOG.md', '!.travis.yml', '!jshintignore', '!codesniffer.ruleset.xml', '*'], { 'buffer': false } ) + .pipe( replace( '/js/jquery.slim.min.js', '/js'+paths.vendor+'/jquery.slim.min.js', { 'skipBinary': true } ) ) + .pipe( replace( '/js/popper.min.js', '/js'+paths.vendor+'/popper.min.js', { 'skipBinary': true } ) ) + .pipe( replace( '/js/skip-link-focus-fix.js', '/js'+paths.vendor+'/skip-link-focus-fix.js', { 'skipBinary': true } ) ) + .pipe(gulp.dest( paths.dist ) ); }); // Deleting any file inside the /dist folder gulp.task( 'clean-dist', function () { - return del([paths.dist + '/**']); + return del( [paths.dist + '/**'] ); }); // Run @@ -279,9 +279,9 @@ gulp.task( 'clean-dist', function () { gulp.task( 'dist-product', ['clean-dist-product'], function() { return gulp.src( ['**/*', '!'+paths.bower, '!'+paths.bower+'/**', '!'+paths.node, '!'+paths.node+'/**', '!'+paths.dist, '!'+paths.dist+'/**', '!'+paths.distprod, '!'+paths.distprod+'/**', '*'] ) .pipe( gulp.dest( paths.distprod ) ); -}); +} ); // Deleting any file inside the /dist-product folder gulp.task( 'clean-dist-product', function () { return del( [paths.distprod + '/**'] ); -}); +} );