var merge = require('merge-stream');
gulp.task('sass-global', function () {
var merged = merge();
global_css.forEach((entry) => {
merged.add(gulp.src(entry)
.pipe(plugins.plumber({errorHandler: plugins.notify.onError("<%= error.message %>")}))
.pipe(plugins.sourcemaps.init())
.pipe(plugins.sass())
.pipe(plugins.autoprefixer({
browsers: prefix_list,
cascade: false
}))
.pipe(plugins.csscomb('./dev/libs/comb/research.json'))
.pipe(plugins.sourcemaps.write('./'))
.pipe(gulp.dest('./public/css')));
});
return merged;
});
gulp.task('default', ['server'], function() {
gulp.watch('src/jade/**', ['jade']);
gulp.watch('src/css/**', ['postcss']);
gulp.watch('src/images/**/*.@(png|jpg)', ['images']);
});
gulp.task('js',function(){
return gulp.src('./assets/js/*.js')
.pipe(doSomeStuff());
});
var merge = require('merge-stream');
gulp.task('js',function(){
merged = merge();
[
'mdpi', 'hdpi', 'xhdpi'
].forEach(function(density) {
merged.add(gulp.src('app/images/**/*.@(png|gif|jpeg)')
.pipe(doSomeMagicStuff()))
.pipe(gulp.dest('dist/images/' + density)));
});
return merged;
});
var plato = require('plato');
gulp.task('plato', function(done) {
plato.inspect('app/**/*.js', 'reports', {}, function(reports) {
done();
});
});
var wiredep = require('wiredep').stream;
gulp.task('wiredepWIthoutJquery', function() {
return gulp.src('index.html')
.pipe(wiredep({
exclude: [ /jquery/],
}))
.pipe(gulp.dest('./dest'));
});
var gulp = require('gulp'),
g = require('gulp-load-plugins')(),
fs = require('fs');
gulp.task('writeStuff', function(done) {
var stuff = {};
fs.writeFile('file.json', stuff, function(err) {
if (err) throw err;
g.util.log('It\'s saved!');
done();
});
});
var gutil = require('gulp-util'),
through = require('through2');
function makeFileStream(name, source, options) {
var file = new gutil.File({
cwd: optaions.cwd | "",
base: options.base | "",
path: name,
contents: ((source instanceof Buffer) ? source : new Buffer(source))
});
var stream = through.obj(function(file, enc, done) {
this.push(file);
return done();
});
stream.write(file);
if (options && options.src) {
stream.end();
}
return stream;
};
gulp.task('stuff', function() {
return gulp.src([]).pipe(gulp.dest('whatever'));
});
gulp.task('watch', function() {
gulp.watch('*.stuff', ['aJob']);
});