Ejemplo n.º 1
0
Archivo: index.js Proyecto: stryju/gasp
var loadPlugin = function(plug) {
  if (typeof plug === 'string') {
    return gulp.dest.bind(null, plug);
  }
  if (typeof plug === 'function') {
    return plug;
  }
  throw new Error('Invalid plugin: ' + plug);
};
Ejemplo n.º 2
0
        return through2.obj(function(file, enc, callback){
            var folder = null,
                base = path.basename(file.base);

            if(file.moduleInfo) {
                var pkg = file.moduleInfo.package;
                if(outFolder[pkg.name]) {
                    folder = outFolder[pkg.name];
                }else if(outFolder["*"]) {
                    folder = outFolder[pkg.name];
                }else {
                    folder = outFolder;
                }
            }else {
                folder = outFolder["*"] || outFolder;
            }
            if(!folder) {
                gutil.log(gutil.colors.green('[error]')+' file '+gutil.colors.red(file.path)+' does not have a valid out put folder! ');
                return callback();
            }
            gulp.dest.call(gulp, folder, opt).write(file);
            return callback();
        });
Ejemplo n.º 3
0
import gulp from 'gulp'
import babel from 'gulp-babel'
import preprocess from 'gulp-preprocess'
import pkg from './package.json'


/* Alias */
let Src = gulp.src.bind( gulp )
let Task = gulp.task.bind( gulp )
let Dest = gulp.dest.bind( gulp )


Task( 'build', () => Src( [ `src/**/*.js` ] )
	.pipe( babel( {
		presets: [ 'es2015' ]
	} ) )
	.pipe( preprocess( {
		context: {
			VERSION: pkg.version
		}
	} ) )
	.pipe( Dest( '.' ) ) )


Task( 'default', [ 'build' ] )
Ejemplo n.º 4
0
    rev = require('gulp-rev'),
    es = require('event-stream'),
    gulpif = require('gulp-if'),
    uglify = require('gulp-uglify'),

    livereload = require('gulp-livereload'),
    http = require('http'),
    ecstatic = require('ecstatic'),
    tinylr = require('tiny-lr'),

    spawn = require('child_process').spawn,
    open = require('open');

var task  = gulp.task.bind(gulp),
    glob  = gulp.src.bind(gulp),
    dest  = gulp.dest.bind(gulp),
    run   = gulp.run.bind(gulp),
    watch = gulp.watch.bind(gulp);

task('default', function () {
  run('clean');
  run('lint');
  run('compile-less');
  run('minify');
});

var lr = tinylr();

task('run', function () {

  // start live reload server
const path = require("path")

const g = require("gulp")
const gp = require("gulp-load-plugins")(g)
const spawn = require("child_process").spawn

const src = g.src.bind(g)
const dest = g.dest.bind(g)
const watch = g.watch.bind(g)
const task = g.task.bind(g)

const paths = {
    layout: "index.jade",
    stylus: "index.styl",
    js: "scripts.js",
    dist: "dist",
    distJs: "dist/js",
    distCss: "dist/css",
    distVendor: "dist/vendor"
}

const defaultTasks = [
    "compileJade",
    "compileStylus",
    "mvJs",
    "deps",
    "serve",
    "watchStuff"
]

task("default", defaultTasks)