Пример #1
0
gulp.task('lint', function() {
  return gulp.src(scripts)
    .pipe(ignore("*.min.js"))
    .pipe(ignore('node_modules/**'))
    .pipe(jshint())
    .pipe(jshint.reporter(stylish))
    .pipe(jshint.reporter('fail'));
});
Пример #2
0
    task: function jsmin(gulp) {
        var uglify = require('gulp-uglify');
        var ignore = require('gulp-ignore');

        return gulp.src('./build/public/**/*.js')
            .pipe(ignore.exclude(['**/node_modules/**', '**/*.css.js', '**/*.css-*.js']))
            .pipe(ignore('**/node_modules/**'))
            .pipe(ignore('**/build/public/js/vendor/**'))
            .pipe(uglify())
            .pipe(gulp.dest('./build/public/'));
    }
Пример #3
0
gulp.task('clean', function (cb) {
	if (!isDemo) {
		rimraf(destination, cb);
	}
	else {
		return gulp.src('../exiletrade.github.io/**/*', {read: false})
			.pipe(ignore('.git/**'))
			.pipe(ignore('.gitignore'))
			.pipe(gulpRimraf({force: true}));

		cb();
	}
});
Пример #4
0
 return crowdinApi.downloadAllTranslations('tab-wrangler').then(allTranslationsZip => {
   return gulp
     .src(allTranslationsZip)
     .pipe(unzip())
     .pipe(
       ignore(function(file) {
         const contents = JSON.parse(file.contents.toString('utf8'));
         if (contents != null) {
           // Files with translations contain Objects, files with no translations contain Arrays.
           // `Object.keys(array)` returns an empty Array, so empty files will be excluded.
           const keys = Object.keys(contents);
           if (keys.length > 0) {
             return false;
           }
         }
         return true;
       })
     )
     .pipe(
       rename(function(path) {
         switch (path.dirname) {
           case 'es-ES':
             // Crowdin names its base Spanish locale "es-ES", but Chrome only supports the
             // non-suffixed "es" locale. Rename the file so it moves to the right place.
             path.dirname = 'es';
             break;
           default:
             break;
         }
       })
     )
     .pipe(gulp.dest(`${__dirname}/_locales/`));
 });
Пример #5
0
gulp.task('css', ['stylus'], function() {
    return gulp.src([
        ''
    ])
    .pipe(cssmin())
    .pipe(gulpIgnore('*.min'))
    .pipe(concat('build.css'))
    .pipe(gulp.dest('public/css'))
});
Пример #6
0
    task: function sass(gulp) {
        var sass = require('gulp-sass');
        var ignore = require('gulp-ignore');

        return gulp.src('./build/public/**/*.scss')
            .pipe(ignore('**/node_modules/**'))
            .pipe(sass())
            .pipe(gulp.dest('./build/public'));
    }
Пример #7
0
gulp.task('convert-to-jsps', function() {
    return gulp.src(['./build/**/*.html'])
        .pipe(ignore('googlebe0cad774c83461d.html'))
        .pipe(inject.prepend('<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>\n'))
        .pipe(inject.after('<!DOCTYPE html>', '\n<!-- ${pageContext.request.servletPath} -->\n'))
        .pipe(rename({
            extname: '.jsp'
        }))
        .pipe(gulp.dest(PATHS.deploy));
});
Пример #8
0
gulp.task('build:vendors', function () {
  var bowerConfig = JSON.parse(fs.readFileSync('./.bowerrc', 'utf8'));

  var src = [
    './' + bowerConfig['directory'] + '/remark/out/*.js'
  ];

  return gulp.src(src)
    .pipe(ignore('*.ts'))
    .pipe(gulp.dest('./build/js/'));
});
Пример #9
0
gulp.task('scripts', function() {
  gulp.src(source_files.vendor_scripts)
      .pipe(debug({title: "vendor-scripts"}))
      .pipe(vendor('vendor.js'))
      .pipe(gulp.dest(dist_folders.scripts));

  return gulp.src(source_files.scripts)
      .pipe(debug({title: "scripts"}))
      .pipe(ignore('_*.js'))
      .pipe(include())
      .pipe(plumber())
      .pipe(gulp.dest(dist_folders.scripts));
});
Пример #10
0
gulp.task('styles', function() {
  return gulp.src(source_files.styles)
      .pipe(ignore('_*.styl'))
      .pipe(debug({title: "styles"}))
      .pipe(plumber())
      .pipe(stylus({
          use: [
            typographic(),
            poststylus(['lost', 'autoprefixer'])
          ]
      }))
      .pipe(minifyCss({compatibility: 'ie8'}))
      .pipe(gulp.dest(dist_folders.styles));
});
gulp.task('default', function () {

    var opts = {};
    opts.cmd = 'pandoc';
    opts.args = [];
    opts.args.push('--atx-headers');
    opts.args.push('--columns=10000');
    opts.args.push('-f');
    opts.args.push('html');
    opts.args.push('-t');
    opts.args.push('markdown');

    var magic = function (file, opts, cb) {
        var _from = path.join(__dirname, src_docs);
        var _to = path.join(__dirname, dest_docs);
        return cb(file, opts);
    };
    watch({glob: path.join(src_docs, '**/*.html') })
        .on('error', gutil.log)
        .pipe(plumb())
        .pipe(ignore({isDirectory: true})).on('data', function (file) {
            gutil.log('filepath:' + file.path);
            file.orig_path = file.path;
        })
        .pipe(spawn(opts, magic)).on('failure', gutil.log).on('data', function(data){
            gutil.log(data);
        })
        .pipe(rename({ext: ".md"}))
        .pipe(gulp.dest(dest_docs)).on('data', function (file) {
                if (!file.path)
                    return;
                var
                    abs_path_to = path.normalize(__dirname + '/' + file.path),
                    to = path.normalize(dest_docs + '/' + path.relative(__dirname + '/' + src_docs, abs_path_to)),
                    from = path.relative(__dirname, file.orig_path);
                gutil.log("Compiled '" + from + "' to '" + to + "'");

            })
        .pipe(livereload(server));

});
Пример #12
0
gulp.task('distribute-default-license', ['clean'], function () {
    var defaultLicense = './LICENSE*';
    var baseModule = gulp.src(defaultLicense, { base: './' })
        .pipe(rename(function (path) {
            path.dirname = settings.baseProject;
        }))
        .pipe(gulp.dest(settings.dest));

    var merged = merge(baseModule);
    var modulesLength = settings.subModules.length;
    for (var i = 0; i < modulesLength; i++) {
        var subModule = settings.subModules[i];
        var module = gulp.src(defaultLicense, { base: './' })
            .pipe(ignore(settings.baseProject))
            .pipe(gulp.dest(settings.dest + subModule));

        merged.add(module);
    }

    return merged;
});
Пример #13
0
gulp.task('cleancss', function() {
  return gulp.src('./css/*.min.css', { read: false }) // much faster 
    .pipe(ignore('theme.css'))
    .pipe(rimraf());
});
Пример #14
0
 gulp.task('cleanupFinal', function() {
 	return 	gulp.src(['./assets/bower_components','**/.sass-cache','**/.DS_Store'], { read: false }) // much faster
		 		.pipe(ignore('node_modules/**')) //Example of a directory to ignore
		 		.pipe(rimraf({ force: true }))
		 		// .pipe(notify({ message: 'Clean task complete', onLast: true }));
 });
Пример #15
0
gulp.task('default', function() {

    var
    opts = {};
    opts.cmd = 'pandoc';
    opts.args = [];

    // global pandoc opts
    opts.args.push('--toc');
    opts.args.push('--mathjax');
    opts.args.push('-S');
    opts.args.push('-s');
    opts.args.push('-t');
    opts.args.push('revealjs');
    opts.args.push('--template=' + path.join(__dirname, './assets/revealjs.html'));
    opts.args.push('-V');
    opts.args.push('theme=sky');
    opts.args.push('-V');
    opts.args.push('highlight-theme=zenburn');
    opts.args.push('-V');
    opts.args.push('revealjs-url=../../reveal.js');
    opts.args.push('--no-highlight'); //For pandoc highlights not reveal
    opts.args.push('--toc-depth=1');

    var magic = function(file, opts, cb) {

        var
        // meta stuff
        _from = path.join(__dirname, src_docs),
        _to = path.join(__dirname, dest_docs),
        new_file_path_dir = path.dirname(file.path.replace(_from, _to)),

        // assets
        jquery = '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js',

        // mathjax = path.join(__dirname, './html/assets/mathjax-MathJax-727332c/MathJax.js'),
        mathjax = 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML',
        mathjax_lazy = path.join(__dirname, './html/assets/mathjax-lazyload.min.js'),
        css = path.join(__dirname, './assets/custom.css');

        // mark assets relative to 'this' file
        var relpath = function(asset) {
            return path.relative(new_file_path_dir, asset);
        };

        // add css
        opts.args.push('-c');
        opts.args.push(relpath(css));

        // custom template vars
        opts.args.push('--variable=jquery-src:' + relpath(jquery));
        opts.args.push('--variable=mathjax-src:' + relpath(mathjax));
        opts.args.push('--variable=mathjax-lazy-src:' + relpath(mathjax_lazy));

        return cb(file, opts);
    };

    //For image assets, etc...
    watch(path.join(src_docs, '**/!(*.md)'))
        .on('error', console.log)
        .pipe(plumb())
        .pipe(ignore({isDirectory:true}))
            .on('data', function(file) {
                file.orig_path = file.path;
            })
	.pipe(gulp.dest(dest_docs))
            .on('data', function(file) {
	//console.log(file);
                if(!file.path)
                    return;
                var
                abs_path_to = path.normalize(__dirname + '/' + file.path),
                to = path.normalize(dest_docs + '/' + path.relative(__dirname + '/' 			+ src_docs, abs_path_to)),
                from = path.relative(__dirname, file.orig_path);

                gutil.log("Deployed asset '" + from + "' to '" + to + "'");

            })
        .pipe(livereload());


    watch(path.join(src_docs, '**/*.md'))
        .on('error', console.log)
        .pipe(plumb())
        .pipe(ignore({isDirectory:true}))
            .on('data', function(file) {
                file.orig_path = file.path;
            })
        .pipe(spawn(opts, magic))
            .on('failure', console.log)
        .pipe(rename({extname: ".html"}))
       .pipe(gulp.dest(dest_docs))
            .on('data', function(file) {

                if(!file.path)
                    return;
                var
                abs_path_to = path.normalize(__dirname + '/' + file.path),
                to = path.normalize(dest_docs + '/' + path.relative(__dirname + '/' + src_docs, abs_path_to)),
                from = path.relative(__dirname, file.orig_path);

                gutil.log("Compiled '" + from + "' to '" + to + "'");

            })
        .pipe(livereload());





});
Пример #16
0
 gulp.task('clean-pre', function() {
   return gulp
     .src([paths.dest, paths.tmp], {read: false})
     .pipe(ignore('node_modules/**'))
     // .pipe(rimraf());
 });
Пример #17
0
gulp.task('scripts', ['babelify'], function() {
    return gulp.src('src/js/*.js')
        .pipe(ignore('react_layout.js'))
        .pipe(concat('main.js'))
        .pipe(gulp.dest('build/js'));
});
Пример #18
0
gulp.task( 'cleancss', function() {
  return gulp.src( paths.css + '/*.min.css', { read: false } ) // Much faster
    .pipe( ignore( 'child-theme.css' ) )
    .pipe( rimraf() );
});
Пример #19
0
gulp.task('clean', function(cb){
	return gulp.src( "./" + config.build + '/**/*.css', { read: false }) // much faster
  	.pipe(ignore('bootstrap.min.css'))
  	.pipe(rimraf());
});