, config = require('../gulpconfig').fonts , browserSync = require("browser-sync").get('My server') , del = require('del') ; gulp.task('fonts', function() { return gulp.src(config.globs) .pipe($.flatten()) .pipe(gulp.dest(config.dist)) .pipe(browserSync.stream()); }); gulp.task ('font-css', function() { return gulp.src([config.src + config.css ]) //Gather up all the 'stylesheet.css' files .pipe($.concatUtil(config.scssName)) //Concat them all into a single file .pipe($.concatUtil.header(config.header)) .pipe($.replace("url('", "url('"+config.urlReplace)) .pipe(gulp.dest(config.scssDest)); // Put them in the assets/styles/components folder }); // Remove the font-face SCSS file if a cleanup is run gulp.task('clean-font-css', del.bind(null, [config.scssDest+'/'+config.scssName])); gulp.task('watch-font-css', function() { gulp.watch([config.src + config.css], ['font-css']); }); gulp.task('watch-fonts', function() { gulp.watch([config.src + '/**/*'], ['fonts']); });
// generated on 2016-01-06 using generator-gulp-webapp 1.0.3 import gulp from 'gulp'; import gulpLoadPlugins from 'gulp-load-plugins'; import browserSync from 'browser-sync'; import del from 'del'; import {iconfont as config} from '../../config'; const $ = gulpLoadPlugins(); gulp.task('demo:iconfont', ['demo:iconfont:clean'], () => { browserSync.notify('Compiling iconfont'); return gulp.src(config.development.src) .pipe($.iconfontCss({ fontName: config.fontname, path: config.iconfontCss.path, targetPath: config.iconfontCss.targetPath, fontPath: config.iconfontCss.fontPath })) .pipe($.iconfont({ fontName: config.fontname, formats: config.formats, normalize: true, fontHeight: 1001 })) .pipe(gulp.dest(config.development.dest)); }); gulp.task('demo:iconfont:clean', del.bind(null, config.files));
prodApp: config.paths.dist + '/' + config.outputFilename.prod }; //------------------------------------------------------------------------------ function getBrowserify(sourmapsFlag){ return browserify({ entries: config.js.main, // if true that will generate sourcemaps output inside of bundle file debug: !!sourmapsFlag }); } //------------------------------------------------------------------------------ gulp.task('clean', del.bind(null, [ config.paths.dist ])); gulp.task('jshint', function() { return gulp .src([ config.js.files ]) .pipe(jshint()) .pipe(jshint.reporter('jshint-summary')) .pipe(jshint.reporter('fail')); }); //--- gulp.task('compile:dev', ['clean', 'jshint'], function() { return getBrowserify(true) .bundle() .pipe(source(config.outputFilename.dev))
import gulp from 'gulp'; import gutil from 'gulp-util'; import hbsfy from 'hbsfy'; import plumber from 'gulp-plumber'; import sass from 'gulp-sass'; import tap from 'gulp-tap'; /* Default task */ gulp.task('default', function() { gulp.start('build'); }); /* Removing whole ./dist/ directory */ gulp.task('clean', del.bind(null, './dist')); /* Building JS */ gulp.task('js', function() { return gulp.src('./src/js/main.js') .pipe(plumber()) .pipe(tap(function(file) { const dom = domain.create(); dom.on('error', function(err) { gutil.log( gutil.colors.red('Browserify compile error:'), err.message, '\n\t', gutil.colors.cyan('in file'), file.path ); gutil.beep();
.pipe($.if(!browserSync.active, $.eslint.failAfterError())); } gulp.task('eslint', eslint(['**/*.js'])); gulp.task('jsdoc', $.shell.task([ 'node_modules/.bin/jsdoc --verbose -c jsdoc.conf.json', ])); // Push documentation to github gulp.task('gh-pages', $.shell.task([ 'git push origin --delete gh-pages', `git subtree push --prefix docs/htz-a11y-dropdown/${pkg.version} origin gh-pages`, ])); gulp.task('cleanDocs', del.bind(null, ['docs'])); gulp.task('serve', () => { browserSync({ notify: true, port: 9001, server: { baseDir: './', }, }); gulp.watch(['src/**/*.js', 'test.js', 'index.html'], ['eslint']).on('change', reload); }); gulp.task('serve:docs', () => { browserSync({
//copy assets in dist folder gulp.task('copy', function () { return gulp.src([ config.base + '/*', '!' + config.base + '/*.html', '!' + config.base + '/src', '!' + config.base + '/test' ]).pipe(gulp.dest(config.dist)) .pipe($.size({ title: 'copy' })); }); //clean temporary directories gulp.task('clean', del.bind(null, [config.dist, config.tmp])); //lint files gulp.task('jshint', function () { return gulp.src(config.js) .pipe(reload({ stream: true, once: true })) .pipe($.jshint()) .pipe($.jshint.reporter('jshint-stylish')) .pipe($.if(!browserSync.active, $.jshint.reporter('fail'))); }); /* tasks supposed to be public */
// Unit test. gulp.task('test', (done) => { new karmaServer({ configFile: __dirname + '/karma.conf.js', singleRun: true, }, done).start() //.on('error', err => console.log('Error : ' + err.message)) }) gulp.task('watch-test', () => { new karmaServer({ configFile: __dirname + '/karma.conf.js', }).start() }) gulp.task('clean', del.bind(null, [ `${DEST_DIR}/index.html`, `${ASSETS_DIR}`, ])) const SRC_DIR = './src' const DIST_DIR = './dist' const SERVER_DIR = './server' gulp.task('release', () => { gulp.src([`${SRC_DIR}/index.html`, ], {base: SRC_DIR}) .pipe(gulp.dest(DIST_DIR)) gulp.src([`${SRC_DIR}/assets/**/*`], {base: SRC_DIR}) .pipe(gulp.dest(DIST_DIR))
import gulp from 'gulp'; import del from 'del'; import ordinaryConfig from '../config'; const config = ordinaryConfig; gulp.task('del', del.bind(null, config.dest));
// Concatenate And Minify JavaScript gulp.task('scripts', function() { var sources = [ 'node_modules/jquery/dist/jquery.js', 'node_modules/swiper/dist/js/swiper.jquery.js', 'src/scripts/app.js' ]; return gulp.src(sources) .pipe($.concat('main.min.js')) .pipe($.uglify({preserveComments: 'some'})) // Output Files .pipe(gulp.dest('kiosk/scripts')) .pipe($.size({title: 'scripts'})); }); // Clean Output Directory gulp.task('clean', del.bind(null, ['.tmp', 'kiosk','dist','src/build'])); // Build Production Files, the Default Task gulp.task('default', ['clean'], function(cb) { runSequence(['styles','templates'], ['html', 'images'], cb); });
// Concatenate And Minify Styles // In case you are still using useref build blocks .pipe($.if('*.css', $.csso())) .pipe(assets.restore()) .pipe($.useref()) // Update Production Style Guide Paths .pipe($.replace('components/components.css', 'components/main.min.css')) // Minify Any HTML .pipe($.if('*.html', $.minifyHtml())) // Output Files .pipe(gulp.dest('dist')) .pipe($.size({title: 'html'})); }); // Clean Output Directory gulp.task('clean', del.bind(null, ['.tmp', 'dist/*', '!dist/.git'])); // Watch Files For Changes & Reload gulp.task('serve', ['styles'], function () { browserSync({ notify: false, // Run as an https by uncommenting 'https: true' // Note: this uses an unsigned certificate which on first access // will present a certificate warning in the browser. // https: true, server: ['.tmp', 'app'] }); gulp.watch(['app/**/*.html'], reload); gulp.watch(['app/styles/**/*.{scss,css}'], ['styles', reload]); gulp.watch(['app/scripts/**/*.js'], ['jshint']);
filter: '**/*.{eot,svg,ttf,woff,woff2}' }).concat('app/fonts/**/*')) .pipe(gulp.dest('.tmp/fonts')) .pipe(gulp.dest('../public/fonts')); }); gulp.task('extras', () => { return gulp.src([ 'app/*.*', '!app/*.html' ], { dot: true }).pipe(gulp.dest('../public')); }); gulp.task('clean', del.bind(null, ['.tmp', '../public'])); gulp.task('serve', ['styles', 'fonts'], () => { browserSync({ notify: false, port: 9000, server: { baseDir: ['.tmp', 'app'], routes: { '/bower_components': 'bower_components' } } }); gulp.watch([ 'app/*.html',
precision: 10, loadPath: ['bower_components'] }) .on('error', console.error.bind(console)) ) .pipe($.autoprefixer(AUTOPREFIXER_BROWSERS)) .pipe($.if('*.css[]', $.csso())) .pipe($.flatten()) //.pipe(replace(/octicons\.([eot|woff|ttf|svg])/g, "/dist/fonts/octicons.$1")) //.pipe(minifyCSS()) .pipe(gulp.dest('web/dist/styles')) .pipe($.size({title: 'styles'})); }); // Clean Output Directory gulp.task('clean', del.bind(null, ['web/dist'])); // Livereload gulp.task('listen', function () { livereload.listen(); }); gulp.task('watch', function() { gulp.watch(['app/Resources/**/*.html.twig'], livereload.changed); gulp.watch(['vendor/digitalkaoz/issues-bundle/scss/*.scss'], ['styles', livereload.changed]); gulp.watch(['vendor/digitalkaoz/issues-bundle/jsx/**/*.js'], ['jsx', livereload.changed]); gulp.watch(['vendor/digitalkaoz/issues-bundle/jsx/**/*.jsx'], ['jsx', livereload.changed]); }); // Default Task gulp.task('default', ['clean'], function (cb) {
var config = { defaultPort: 3000, supportedBrowsers: [ 'ie >= 9', 'last 1 Firefox versions', 'last 1 Chrome versions', 'Safari >= 6', 'iOS >= 6', 'ChromeAndroid >= 4.2' ], version: require('./package.json').version, minify: argv.minify || false }; // Clean site directory gulp.task('clean', del.bind(null, ['dist'], {dot: true})); gulp.task('styles', function() { gulp.src('src/sass/**/*.scss') .pipe(sourcemaps.init()) // Initialize sourcemap plugin .pipe(sass()) .pipe(autoprefixer()) // Passes it through gulp-autoprefixer .pipe(sourcemaps.write()) // Writing sourcemaps .pipe(gulp.dest('dist/css')) // Outputs it in the css folder // Reloading the stream .pipe(browserSync.reload({ stream: true })); });
'ios >= 7', 'android >= 4.4', 'bb >= 10' ]; var DEST_BASE = "build/" var src = {}; var watch = false; var browserSync = require('browser-sync'); // The default task gulp.task('default', ['watch']); // Clean output directory gulp.task('clean', del.bind( null, ['.tmp', 'build/*', '!build/.git'], {dot: true} )); // HTML gulp.task("html", function() { src.html = [ "src/*.html" ] var dest = DEST_BASE return gulp.src(src.html) .pipe($.changed(dest)) .pipe(gulp.dest(dest)) .pipe($.size({title: 'html'})); }); // Static files
'use strict'; var gulp = require('gulp'); var $ = require('gulp-load-plugins')(); var del = require('del'); var SRC = 'js'; var OUT = 'web/js'; gulp.task('scripts', function () { return gulp.src(SRC + '/*.js') .pipe($.browserify()) .pipe($.uglify()) .pipe(gulp.dest(OUT)) .pipe($.size({title: 'scripts'})); }); gulp.task('clean', del.bind(null, [OUT])); gulp.task('default', ['clean', 'scripts']);
'use strict'; // Include Gulp & tools we'll use var gulp = require('gulp'); var del = require('del'); var runSequence = require('run-sequence'); // Load tasks from the `tasks` directory try { require('require-dir')('gulp'); } catch (err) { console.error(err); } // Clean output directory gulp.task('clean', del.bind(null, ['.tmp', 'dist/*', '!dist/.git'], {dot: true})); // Build production files, the default task gulp.task('default', ['clean'], function (cb) { runSequence('styles', ['jshint', 'html', 'scripts', 'images', 'fonts', 'copy'], cb); });
gulp.task('replace', () => { return gulp.src(basePaths.dev + '/{,*/}*.html') .pipe(replace({ patterns: [ { match: '../../assets/', replacement: '../assets/' } ], usePrefix: false, preserveOrder: true })) .pipe(gulp.dest(basePaths.dev)) }); gulp.task('clean', del.bind(null, ['.tmp', basePaths.dist])); gulp.task('serve', ['styles', 'scripts', 'jekyll-build', 'html'], () => { browserSync.init({ notify: false, port: 9499, server: { baseDir: ['.tmp', basePaths.dist], routes: { '/scripts': basePaths.dist + '/scripts', '/styles': basePaths.dist + '/styles', '/assets': basePaths.dist + '/assets', } } });
// Concatenate and minify styles // In case you are still using useref build blocks .pipe($.if('*.css', $.csso())) // .pipe(assets.restore()) .pipe($.useref()) // Update production Style Guide paths // .pipe($.replace('components/components.css', 'components/main.min.css')) // Minify any HTML .pipe($.if('*.html', $.minifyHtml())) // Output files .pipe(gulp.dest(config.root.dest)) .pipe($.size({title: 'html'})); }); // Clean output directory gulp.task('clean', del.bind(null, ['.tmp', config.root.dest], {dot: true})); // Watch files for changes & reload gulp.task('serve', ['styles'], function () { browserSync({ notify: false, // Customize the BrowserSync console logging prefix logPrefix: 'Icaque', // Run as an https by uncommenting 'https: true' // Note: this uses an unsigned certificate which on first access // will present a certificate warning in the browser. // https: true, server: ['.tmp', config.root.dest] }); gulp.watch(config.html.watch, ['copy', reload]);
gulp.task('extras', () => { return gulp.src([ 'app/*.*', '!app/*.html' ], { dot: true }).pipe(gulp.dest('dist')) .pipe(notify({ message: 'Extras tasked finished!' })); }); gulp.task('clean', del.bind(null, ['.tmp', 'dist', 'rev','app/styles/index.css'])); gulp.task('serve', ['styles','lessStyle', 'scripts', 'fonts'], () => { browserSync({ notify: false, port: 9000, server: { baseDir: ['.tmp', 'app'], routes: { '/bower_components': 'bower_components' } } });
var pkgs = (function () { var temp = {}; var map = function (source) { for (var key in source) { temp[key.replace(/[^a-z0-9]/gi, '')] = source[key].substring(1); } }; map(require('./package.json').dependencies); return temp; }()); // The default task gulp.task('default', ['serve']); // Clean up gulp.task('clean', del.bind(null, [DEST])); // CSS style sheets gulp.task('styles', function () { src.styles = 'src/styles/**/*.{css,less}'; return gulp.src([src.styles]) .pipe($.plumber()) .pipe($.less({ sourceMap: !RELEASE, sourceMapBasepath: __dirname })) .on('error', console.error.bind(console)) .pipe($.autoprefixer({browsers: AUTOPREFIXER_BROWSERS})) .pipe($.csscomb()) .pipe($.if(RELEASE, $.minifyCss())) .pipe(gulp.dest(DEST + '/css'))
var gulp = require('gulp'); var $ = require('gulp-load-plugins')(); var del = require('del'); var isProduction = ($.util.env.dev || $.util.env.debug ? false : true); var isDebug = !isProduction; $.util.log('Environment: ' + (isProduction ? 'PRODUCTION' : 'DEBUG')); gulp.task('default', ['clean'], function() { gulp.start('build'); }); gulp.task('clean', del.bind(null, ['dist/**/*'])); -gulp.task('build', ['content', 'markup', 'templateHelpers', 'templates', 'views', 'icons', 'images', 'styles', 'jsLibs', 'scripts'], function() { if (isProduction) { gulp.start('size'); } }); gulp.task('size', function() { return gulp.src('dist/**/*') .pipe($.size({ title: 'Build size total for', showFiles: true, gzip: true })); }); gulp.task('watch', function() { gulp.watch('app/styles/**/*.less', ['styles']); gulp.watch('app/templates/**/*.hbs', ['templates']); gulp.watch('app/views/**/*.hbs', ['views']); });
var gulp = require('gulp'); var del = require('del'); var babel = require('gulp-babel'); gulp.task('lib:clean', del.bind(null, './lib')); gulp.task('lib', ['lib:clean'], function () { return gulp.src('./src/**/*.js') .pipe(babel())// auto use .babelrc .pipe(gulp.dest('./lib')); }); gulp.task('watch:lib', ['lib'], function () { return gulp.watch('./src/**/*.js', ['lib']); });
// generated on 2016-01-06 using generator-gulp-webapp 1.0.3 import gulp from 'gulp'; import gulpLoadPlugins from 'gulp-load-plugins'; import browserSync from 'browser-sync'; import del from 'del'; import {clean as config} from '../../config'; const $ = gulpLoadPlugins(); gulp.task('clean:production', del.bind(null, config.production.files));
gulp.watch(['scss/**/*.scss', 'DOCS.md'], ['sass:doc']); }); gulp.task('serve:sg', ['sass:sg'], () => { browserSync({ notify: true, port: 9001, reloadDelay: 4000, server: { baseDir: 'styleguide', }, }); gulp.watch(['styleguide/**/*']).on('change', reload); gulp.watch(['scss/**/*.scss', 'sgSrc/**/*', 'DOCS.md'], ['sass:sg']); }); gulp.task('clean', del.bind(null, ['styleguide'])); gulp.task('tdd', ['sass:lint', 'sass:test'], () => { gulp.watch('scss/**/*.scss', ['sass:lint', 'sass:test']); gulp.watch('test/**/*', ['sass:test']); }); gulp.task('prepublish', ['sass:lint', 'sass:test']); gulp.task('build', ['sass:doc', 'sass:sg']); gulp.task('default', () => { gulp.start('tdd'); });
}).pipe(gulp.dest(clientBuildPath)) .pipe($.size({title: 'copy'})); }); // copy to _server/dist gulp.task('copy-server', function () { return gulp.src([ serverAppPath + '/**/*' ], { dot: true }).pipe(gulp.dest(serverBuildPath)) .pipe($.size({title: 'copy'})); }); // Clean Output Directory gulp.task('clean', del.bind(null, ['.tmp', clientBuildPath, serverBuildPath, '.sass-cache'])); gulp.task('browser-sync', function() { browserSync({ server: ['.tmp', clientAppPath], }); }); gulp.task('reload', function() { return gulp.src(clientAppPath) .pipe(reload({stream: true, once: true})); }); // Watch Files For Changes on CLIENT & Reload gulp.task('watch-client',['browser-sync'] ,function () {
return gulp.src(require('main-bower-files')('**/*.{eot,svg,ttf,woff,woff2}', function (err) {}) .concat('app/fonts/**/*')) .pipe(gulp.dest('.tmp/fonts')) .pipe(gulp.dest('dist/fonts')); }); gulp.task('extras', () => { return gulp.src([ 'app/*.*', '!app/*.html' ], { dot: true }).pipe(gulp.dest('dist')); }); gulp.task('clean', del.bind(null, ['.tmp', 'dist'])); gulp.task('serve', ['styles', 'webpack:dev', 'fonts'], () => { browserSync({ notify: false, port: 9000, server: { baseDir: ['.tmp', 'app'], routes: { '/bower_components': 'bower_components' } } }); gulp.watch([ 'app/*.html',
var gulp = require('gulp'), del = require('del'), to5 = require('gulp-6to5'), sourcemap = require('gulp-sourcemaps'), runSequence = require('run-sequence'); var dest = './extension'; gulp.task('clean', del.bind(null, [dest])); gulp.task('compile-to5', function () { return gulp.src('./src/js/*.js') .pipe(sourcemap.init()) .pipe(to5()) .pipe(sourcemap.write()) .pipe(gulp.dest(dest + '/js')); }); gulp.task('touchManifest', function () { return gulp.src('./src/manifest.json') .pipe(gulp.dest(dest)); }); gulp.task('copy', function () { return gulp.src('./src/*.html') .pipe(gulp.dest(dest)); }); gulp.task('compile', function () { runSequence('clean', [