Example #1
0
gulp.task('clean', function() {
  return del(['lib/', 'Flux.js']);
});

gulp.task('default', ['clean'], function() {
  return gulp.src('src/*.js')
             .pipe(babel())
             .pipe(gulp.dest('lib'));

});

gulp.task('build-examples-website', ['clean'], shell.task([[
  'pushd ../react-art-gh-pages',
  'git checkout -- .',
  'git clean -dfx',
  'git pull',
  'rm -rf *',
  'popd',
  'pushd examples/vector-widget',
  'npm install',
  'npm run build',
  'popd',
  'cp -r examples/vector-widget/{index.html,bundle.js} ../react-art-gh-pages',
  'pushd ../react-art-gh-pages',
  'git add -A .',
  'git commit -m "Update website"',
  'popd',
  'echo "react-art-gh-pages ready to push"'
].join(';')]));
Example #2
0
var gulp = require('gulp'),
    shell = require('gulp-shell');

gulp.task('build-tests', shell.task([
  'elm-make --warn test/TestRunner.elm --output .tmp/test.js'
]))

gulp.task('run-tests', ['build-tests'], shell.task([
  'node test.js'
]))

gulp.task('default', function () {
  gulp.run('run-tests')

  gulp.watch(['src/**/*.elm', 'test/**/*.elm'], ['run-tests'])
})
Example #3
0
// Opens toy-problems-repo with sublime
function openSubl() {
  return shell.task([
    'open -a "Sublime Text" toy-problems-repo'
  ], {ignoreErrors: true});
}
Example #4
0
  gulp.src(paths.dependencies)
    .pipe(concat('dependencies.js'))
    .pipe(gulp.dest('www/js/build/'));
});

// serves and watches for files changes
gulp.task('serve', function(){
  nodemon({
    script: 'server.js',
    ext: 'js html'
  });
})

// servers to ionic
gulp.task('serve-ionic', sh.task([
  'ionic serve'
]));

// ios emulation
gulp.task('emulate-ios', sh.task([
    'ionic emulate ios'
]));

gulp.task('watch', function() {
  gulp.watch(paths.audio, ['audio']);
  gulp.watch(paths.sass, ['sass']);
  gulp.watch(paths.dependencies, ['dependencies']);
});

gulp.task('install', ['git-check'], function() {
  return bower.commands.install()
Example #5
0
/**
 * Created by 87676 on 8/8/2016.
 */
var gulp=require("gulp");
var shell=require("gulp-shell");

var src=["Ball.ts","Block.ts","Main.ts"];
var dist=`Main.js`;
var compilePath=`${__dirname}/tools/closure-compiler-v20160713.jar`;

gulp.task("compile",shell.task([`tsc --out ${dist} ${src.join(" ")}`],{cwd:"src"}));
gulp.task("depress",["compile"],shell.task([`java -jar ${compilePath} --js_output_file ../dist/Main.min.js --js Main.js`],{cwd:"src"}));
gulp.task("default",["depress"]);
Example #6
0
    "!www/src/**/*.sass",
    "!www/src/**/*.scss"
];

gulp.task("clean:dist", function(){
    return gulp.src(DIST_PATH)
            .pipe(clean({force: true}));
});

gulp.task("clean:jspm", function(){
    return gulp.src(["www/jspm_packages", "www/config.js"])
            .pipe(clean({force: true}));
});

gulp.task("jspm:install", shell.task("jspm install", {
    interactive: true
}));

gulp.task("copy", function(){
    return gulp
        .src(NATIVE_PATHS)
        .pipe(gulp.dest(DIST_PATH));
});

gulp.task("compile:coffee", function() {
    return gulp.src('www/src/**/*.coffee')
        .pipe(sourcemaps.init())
        .pipe(coffee({bare: true}).on('error', gutil.log))
        .pipe(sourcemaps.write(MAPS_PATH))
        .pipe(gulp.dest(DIST_PATH));
});
Example #7
0
  scripts: [ 'server/server.js', 'app/util/*.js'],
  html: ['app/**/*.html', 'index.html'],
  styles: ['client/styles/style.css'],
  test: ['specs/*.js']
};

// any changes made to your
// client side code will automagically refresh your page
// with the new changes
gulp.task('start', ['serve'],function () {
  bs({
    notify: true,
    // address for server,
    injectChanges: true,
    files: paths.scripts.concat(paths.html, paths.styles),
    proxy: 'localhost:3000'
  });
});

gulp.task('karma', shell.task([
  'karma start'
]));

// start our node server using nodemon
gulp.task('serve', function() {
  nodemon({script: 'server/server.js', ignore: 'node_modules/**/*.js'});
});

gulp.task('default', ['start']);

    browserSync({
        proxy: 'localhost:8002'
    });
});


gulp.task('sample', function () {
    gulp.src('./_source/*.html')
        .pipe(gulplocaltranslate('5')).on('error', handleError)
        .pipe(gulp.dest('./_tmp/'))
        .pipe(reload());
});


gulp.task('_uploadDocs', shell.task([
    'uploadDocs.bat'
], {cwd: './_utils'}));


gulp.task('_uploadVersionFiles', shell.task([
    'scp /cygdrive/c/msweb/signagestudio_web-lite/package.json Sean@digitalsignage.com:/var/www/sites/dynasite/htdocs/_studiolite-dist/',
    'scp /cygdrive/c/msweb/signagestudio_web-lite/studiolite.mcs.html Sean@digitalsignage.com:/var/www/sites/dynasite/htdocs/_studiolite-dist/'
]));

gulp.task('_genDocs', function () {
    var version = updVersion();
    gulp.src(paths)
        .pipe(yuidoc({
            project: {
                "name": "digitalsignage.com - open source docs",
                "description": "MediaSignage open source SignageStudio project",
Example #9
0
  var app = connect()
    .use(connect.logger('dev'))
    .use(connect.static(Config.publicDir));

  http.createServer(app).listen(Config.port);
});
// ---

// Deployment.
var shell = require('gulp-shell');

gulp.task('deploy', shell.task([
  'git checkout gh-pages',
  'git checkout master -- public .gitignore',
  'cp -r public/* .',
  'git add .',
  'git commit -m "Deployment"',
  'git push origin gh-pages',
  'git checkout master',
  'git clean -fd'
]));
// ---

// Watch.
gulp.task('watch', function() {
  gulp.watch(Config.srcDir + '/stylesheets/**', ['autoprefixer']);
});
// ---

gulp.task('build',   ['autoprefixer']);
gulp.task('default', ['build', 'watch', 'serve']);
Example #10
0
// including plugins
var gulp        = require('gulp');
var shell       = require('gulp-shell');
var browserSync = require('browser-sync').create();
var reload      = browserSync.reload;

gulp.task('docs', shell.task([
 'node node_modules/jsdoc/jsdoc.js '+
   '-c node_modules/jsdoc-template-angular/conf.json '+   // config file
   '-t node_modules/jsdoc-template-angular/template '+    // template file
   '-d ./generated '+                                     // output directory
   './README.md ' +                                       // to include README.md as index contents
   '-r ./src'                                             // source code directory
]));

// Static Server + watching scss/html files
gulp.task('serve', ['docs'], function() {

    browserSync.init({
        server: "./generated"
    });

    gulp.watch(['./src/**/*.js'], ['docs']);
    gulp.watch("./generated/*.html").on('change', reload);
});

gulp.task('default', ['docs']);
Example #11
0
(function () {
  'use strict';

  var gulp = require('gulp');
  var less = require('gulp-less');
  var sourcemaps = require('gulp-sourcemaps');
  var uglify = require('gulp-uglify');
  var csso = require('gulp-csso');
  var jshint = require('gulp-jshint');
  var stylish = require('jshint-stylish');
  var jscs = require('gulp-jscs');
  var mocha = require('gulp-spawn-mocha');
  var tar = require('gulp-tar');
  var gzip = require('gulp-gzip');
  var bumper = require('gulp-bump');
  var git = require('gulp-git');
  var shell = require('gulp-shell');
  var rename = require('gulp-rename');
  var fs = require('fs');
  var sequence = require('gulp-sequence');
  var ngAnnotate = require('gulp-ng-annotate');

  gulp.task('less', function () {
    return gulp.src('./*.less')
      .pipe(sourcemaps.init())
      .pipe(less())
      .pipe(csso())
      .pipe(sourcemaps.write('./'))
      .pipe(gulp.dest('./dist'));
  });

  gulp.task('lint', function () {
    return gulp.src('**/*.js')
      .pipe(jshint())
      .pipe(jshint.reporter(stylish));
  });

  gulp.task('style', function () {
    return gulp.src('**/*.js')
      .pipe(jscs());
  });

  gulp.task('unit', shell.task([
    ' ./node_modules/mocha-phantomjs/bin/mocha-phantomjs -R spec test/index.html '
  ]));

  gulp.task('integration', function () {
    return gulp.src('test/test.integration.js', {read: false})
      .pipe(mocha({ reporter: 'list', timeout: 10000, require: 'test/support/setup.js' }));
  });

  gulp.task('bump-patch', bump('patch'));
  gulp.task('bump-minor', bump('minor'));
  gulp.task('bump-major', bump('major'));

  gulp.task('bower', function () {
    return gulp.src('./angular-chart.js')
      .pipe(ngAnnotate({single_quotes: true}))
      .pipe(gulp.dest('./dist'));
  });

  gulp.task('js', ['lint', 'style', 'bower'], function () {
    return gulp.src('./angular-chart.js')
      .pipe(rename('angular-chart.min.js'))
      .pipe(ngAnnotate({single_quotes: true}))
      .pipe(sourcemaps.init())
      .pipe(uglify())
      .pipe(sourcemaps.write('./'))
      .pipe(gulp.dest('./dist'));
  });

  gulp.task('build', function () {
    return gulp.src(['dist/*', '!./dist/*.tar.gz'])
      .pipe(tar('angular-chart.js.tar'))
      .pipe(gzip({ gzipOptions: { level: 9 } }))
      .pipe(gulp.dest('dist/'));
  });

  gulp.task('update', function (cb) {
    fs.readFile('./examples/charts.template.html', 'utf8', function (err, file) {
      if (err) return cb(err);
      file = file.replace('<!-- version -->', version());
      fs.writeFile('./examples/charts.html', file, cb);
    });
  });

  gulp.task('git-commit', function () {
    var v = version();
    gulp.src(['./dist/*', './package.json', './bower.json', './examples/charts.html'])
      .pipe(git.add())
      .pipe(git.commit(v))
    ;
  });

  gulp.task('git-push', function (cb) {
    var v = version();
    git.push('origin', 'master', function (err) {
      if (err) return cb(err);
      git.tag(v, v, function (err) {
        if (err) return cb(err);
        git.push('origin', 'master', {args: '--tags' }, cb);
      });
    });
  });

  gulp.task('npm', shell.task([
    'npm publish'
  ]));

  gulp.task('watch', function () {
    gulp.watch('./*.js', ['js']);
    gulp.watch('./*.less', ['less']);
    return true;
  });

  function bump (level) {
    return function () {
      return gulp.src(['./package.json', './bower.json'])
        .pipe(bumper({type: level}))
        .pipe(gulp.dest('./'));
    };
  }

  function version () {
    return JSON.parse(fs.readFileSync('package.json', 'utf8')).version;
  }

  gulp.task('default', sequence('check', ['less', 'js'], 'build'));
  gulp.task('test', sequence('unit', 'integration'));
  gulp.task('check', sequence(['lint', 'style'], 'test'));
  gulp.task('deploy-patch', sequence('default', 'bump-patch', 'update', 'git-commit', 'git-push', 'npm'));
  gulp.task('deploy-minor', sequence('default', 'bump-minor', 'update', 'git-commit', 'git-push', 'npm'));
  gulp.task('deploy-major', sequence('default', 'bump-patch', 'update', 'git-commit', 'git-push', 'npm'));

})();
Example #12
0
var gulp    =   require('gulp');
var shell   =   require('gulp-shell');

gulp.task("ts", function(){
    gulp.watch(["./src/**/*.ts", "../../kernel/src/**/*.ts"], ["rebuild"]);
});
gulp.task("vendor", function(){
    gulp.watch(["../../themes/src/**/*.scss"], ["revendor"]);
});
gulp.task("html", function(){
    gulp.watch(["./src/**/*.html"], ["recopy"]);
});
gulp.task("rebuild", shell.task(['gulp --gulpfile gulpfile-ts.js']));
gulp.task("revendor", shell.task(['gulp --gulpfile gulpfile-vendor.js']));
gulp.task("recopy", shell.task(['gulp --gulpfile gulpfile-static.js']));
Example #13
0

function ignoreError() {
  /* jshint ignore:start */ // using `this` in this context is weird 
  this.emit('end');
  /* jshint ignore:end */
}

var testMocha = function() {
  return gulp.src(tests).pipe(new mocha({
    reporter: 'spec'
  }));
};

var testKarma = shell.task([
  './node_modules/karma/bin/karma start --single-run --browsers Firefox'
]);

/**
 * Testing
 */

gulp.task('test:node', ['errors'], testMocha);

gulp.task('test:node:nofail', ['errors'], function() {
  return testMocha().on('error', ignoreError);
});

gulp.task('test:browser', ['browser:uncompressed', 'browser:maketests'], testKarma);

gulp.task('test', function(callback) {
Example #14
0
});

gulp.task('release', ['default'], function() {
    var uglify = require('gulp-uglify');

    return gulp.src('dist/bj.js')
        .pipe(uglify())
        .pipe(rename(config.minifiedFileName))
        .pipe(gulp.dest(config.outputFolder));
});

gulp.task('watch', function() {
    return gulp.watch(['src/**', 'examples'], ['default']);
});

gulp.task('examples',
    shell.task([
        '../../node_modules/.bin/gulp'
    ], {
        'cwd': './examples/shop-i-bem'
    })
);


gulp.task('gh-pages', function() {
    var deploy = require('gulp-gh-pages');

    return gulp.src(['./examples/**/**', 'dist/**', './docs/**/**'])
        .pipe(deploy());
});
Example #15
0
var shell = require('gulp-shell')
var del = require('del');
var runSequence = require('run-sequence');

gulp.task('serve', function () {

    browserSync.init({
        server: {
            baseDir: "./"
        }
    });

    gulp.watch("app/*").on("change", browserSync.reload);
});

gulp.task('jspm-bundle', shell.task("jspm bundle-sfx --minify app build/app.js"));

gulp.task('index-js-replace', function () {
  return gulp.src('index.html')
    .pipe(htmlreplace({'js': 'app.js'}))
    .pipe(gulp.dest('./build/'));
});

gulp.task('copy-html', function () {
  return gulp.src('./app/**/*.html').pipe(gulp.dest('./build/app/'));
});

gulp.task('clean-build', function (cb) {
  del("./build/", cb);
});
 *  This will load all js files in the gulp directory
 *  in order to load all gulp tasks
 */
wrench.readdirSyncRecursive('./gulp').filter(function(file) {
    return (/\.(js)$/i).test(file);
}).map(function(file) {
    require('./gulp/' + file);
});

gulp.task('clean:everything', function() {
    return del('dist');
});


gulp.task('run_backstop_refs',  shell.task([
    'backstop reference'
]));

gulp.task('run_backstop_test', shell.task([
    'backstop test'
]));

gulp.task('open_port', function() {
    var open = require('open');
    var serverPort = 4000;
    var localhost = 'http://localhost:' + serverPort;

    connect.server({
        host: 'localhost',
        port: serverPort,
        livereload: false,
Example #17
0
var gulp = require('gulp');
var shell = require('gulp-shell');
var fs = require('fs');
var myOS = require('os').platform();
var downloadatomshell = require('gulp-download-atom-shell');
var binpath = 'binaries/atom';
if (myOS.substr(0,3) == "win") { binpath = 'binaries\\atom.exe'; }

gulp.task('downloadatomshell', function(cb){
    downloadatomshell({
        version: '0.16.2',
        outputDir: 'binaries'
    }, cb);
});

gulp.task('launch', shell.task([ binpath + ' app' ]));
Example #18
0
  return gulp.src('./test/**/*.js')
    .pipe(semistandard())
    .pipe(semistandard.reporter('default', {
      breakOnError: true
    }));
});

var testsFailed = false;
gulp.task('wdio', ['clean'], function() {
  return gulp.src('wdio.conf.js').pipe(webdriver(customWdioConfig))
  .on('error', function (err) {
    // We still want the report to generate if a test fails, so surpress the error
    testsFailed = true;
    this.emit('end');
  });
});

gulp.task('generate-report', ['clean', 'wdio'], shell.task([
  './node_modules/.bin/allure generate allure-results'
]));

gulp.task('test', ['generate-report'], function () {
  // If tests failed earlier, we want to make sure that gulp exits with 1
  if (testsFailed) {
    console.log('Some tests failed. Check the report by running `npm run report`.');
    process.exit(1);
  }
});

gulp.task('default', ['semistandard', 'test']);
Example #19
0
var pkg = JSON.parse(fs.readFileSync('package.json'));

// RELEASE ---------------------------------------------------------------------

gulp.task('copy', function() {
	return gulp.src([
			'**',
			'!composer.json',
			'!composer.lock',
			'!gulpfile.js',
			'!includes/vendor/autoload.php',
			'!includes/vendor/composer/',
			'!includes/vendor/composer/**',
			'!node_modules/',
			'!node_modules/**',
			'!package.json',
		])
		.pipe(gulp.dest(pkg.name));
});

gulp.task('zip', ['copy'], shell.task(`zip -r ${pkg.name}-${pkg.version}.zip ${pkg.name}`));

gulp.task('export', ['zip'], shell.task(`mv ${pkg.name}-${pkg.version}.zip ~/Desktop/`));

gulp.task('clean', ['export'], function() {
	return del(pkg.name);
});

gulp.task('release', ['copy', 'zip', 'export', 'clean']);
Example #20
0
var gulp = require('gulp');
var shell = require('gulp-shell');

gulp.task('lint', shell.task([
  'virtualenv/bin/autopep8 ./mailchimpy --recursive --in-place',
  'virtualenv/bin/autopep8 ./tests --recursive --in-place'
]));

gulp.task('test', shell.task(
  ['virtualenv/bin/python -m unittest'],
  { ignoreErrors: true }
));

gulp.task('watch', function() {
  gulp.watch('mailchimpy/**/*.py', ['test']);
  gulp.watch('tests/**/*.py', ['test']);
});

gulp.task('default', ['watch']);
    });
});

//fire up our server
gulp.task('dev', function () {
  nodemon({
    script: 'server/server.js',
    ext: 'js html',
    env: { 'NODE_ENV': 'development' }
  })
});

//////DB Tasks//////
gulp.task('init-db', shell.task([
  'initdb db',
  'pg_ctl -D db -l logfile start',
  'createdb dev'
]));

gulp.task('restart-db', shell.task([
  'pkill postgres',
  'pg_ctl -D db -l logfile start'
]));

gulp.task('clear-db', shell.task([
  'dropdb dev',
  'createdb dev'
]));
//////END DB Tasks//////

//watch files
Example #22
0
var paths = {
  scripts: ['src/**/*.js'],
  tests: 'test/**/*.js'
}

gulp.task('default', function () {
})

gulp.task('server', function () {
    gulp.watch(['component.json', 'src/**/*'], ['build'])
    server.listen(serverPort)
})

gulp.task('go-run', shell.task([
   'run'
]))

gulp.task('less', function () {
    gulp.src('assets/css/admin/style.less')
        .pipe(less())
        .pipe(gulp.dest('assets/css/admin/'))
        .pipe(minifyCSS({keepBreaks:false}))
        .pipe(gulp.dest('assets/css/admin/'))
})

gulp.task('watch', function () {
    //server.listen(serverPort)
    //gulp.watch(['**/*.go'], ['go-run'])
    gulp.watch(['*.exe'], ['go-run'])
    gulp.watch(['assets/css/**/*.less'], ['less'])
Example #23
0
// Build Minified Sass
gulp.task('sass:min', function () {
  gulp.src(path.sass)
    .pipe(sourcemaps.init())
    .pipe(sass({outputStyle: 'compressed'})
      .on('error', sass.logError)
      .on('end', function() {gutil.log(gutil.colors.cyan('html5-skin.min.css DONE'));})
    )
    .pipe(rename({suffix: '.min'}))
    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest('./build'))
    .pipe(connect.reload())
});

// Run tests in Jenkins build
gulp.task('test', shell.task(['npm test']));

// Initiate a watch
gulp.task('watch', ['build:watch'], function() {
  gulp.watch(path.sass, ['sass', 'sass:min']);
  gulp.watch(path.pages, ['pages']);
  gutil.log(gutil.colors.blue('WATCHING...'));
});

// The default task (called when you run `gulp` from cli)
gulp.task('default', ['watch', 'open']);

// Generate documentation
gulp.task("docs", shell.task("./node_modules/.bin/jsdoc -c ./jsdoc_conf.json"));

// Assets
Example #24
0
      .on('error', gutil.log))
    .pipe(autoprefixer({
      browsers: autoprefixBrowsers,
      cascade: false
    }))
    .pipe(gulp.dest('./assets/styles'));
});

gulp.task('browserify', function() {
  return browserify('./src/js/app.js')
    .bundle()
    .pipe(source('app.js'))
    .pipe(gulp.dest('./assets/js/'));
});

gulp.task('serve', shell.task([
  'php -S localhost:3000'
]));

gulp.task('watch', function() {
  gulp.watch('./src/scss/**/*.scss', ['sass']);
});

gulp.task('images', () =>
  gulp.src('src/images/*')
    .pipe(imagemin())
    .pipe(gulp.dest('assets/images'))
);

gulp.task('default', ['sass', 'images', 'browserify', 'serve', 'watch']);
Example #25
0
      includePaths: config.sassIncludePaths
    }))
    .pipe(autoprefix('last 2 versions', '> 1%', 'ie 9', 'ie 10'))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('pre/css'));
});

gulp.task('minify-css', ['sass'], function() {
  return gulp.src('pre/css/*.css')
    .pipe(cleanCSS({compatibility: 'ie8'}))
    .pipe(gulp.dest('assets/css'));
});
// Static Server + watching scss files
gulp.task('serve', ['sass', 'minify-css'], function() {
  browserSync.init({
    proxy: config.browserSyncProxy
  })

  gulp.watch('assets/sass/**/*.scss', ['sass']);
  gulp.watch('assets/images/**/*', ['images']);
  gulp.watch('assets/css/**/*').on('change', browserSync.reload);
});

// Run drush to clear the theme registry.
gulp.task('drush', shell.task([
  'drush cache-clear theme-registry'
]));

// Default Task
gulp.task('default', ['serve']);
Example #26
0
gulp.task('html', function() {
    return gulp.src(paths.html)
        .pipe(gulp.dest(paths.build.base))
        .pipe(notify({ message: '[HTML] Copied <%= file.relative %>' }))
        ;
});

gulp.task('bower', function() {
    return gulp.src(paths.bower)
        .pipe(gulp.dest(paths.build.bower))
        .pipe(notify({ message: '[BOWER] Copied bower component <%= file.relative %>' }))
        ;
});

gulp.task('default', [], function() {
    gulp.start('bower', 'cs', 'less', 'html');
});


gulp.task('bootstrap-make', shell.task(
    ['grunt dist'],
    {cwd: './vendor/bootstrap'}
));

gulp.task('bootstrap', ['bootstrap-make'], function() {
    return gulp.src(paths.vendor.bootstrap)
        .pipe(gulp.dest(paths.build.vendor + '/bootstrap'))
        ;
});
Example #27
0
  images: {
    src: ['./app/public/src/img/**/*.*'],
    dist: './app/public/dist/img'
  }
};

gulp.task('stylus', () => {
  gulp.src(paths.stylus.src)
    .pipe(stylus({
      compress: true
    }))
    .pipe(gulp.dest(paths.stylus.dist));
});

gulp.task('webpack:build', shell.task([
  'npm run webpack:build'
]));

gulp.task('webpack:watch', shell.task([
  'npm run webpack:watch'
]));

gulp.task('images', () => {
  gulp.src(paths.images.src)
    .pipe(gulp.dest(paths.images.dist));
});

gulp.task('dev', ['images'], () => {
  gulp.watch(paths.stylus.src, ['stylus']);
});
Example #28
0
var gulp = require('gulp');
var shell = require('gulp-shell');
var open = require('gulp-open');

var nw_builder = require('nw-builder');

gulp.task('test', shell.task(['node_modules/.bin/nw .']));

gulp.task('browser', function(){
  gulp.src('./app/*.html')
  .pipe(open('file://<%= file.path %>', {app: 'firefox-aurora'}));
});

gulp.task('build', function(){
  var nw = new nw_builder({
    files: ['./package.json', './bower.json', './.bowercc', './LICENSE', './README.md', './app/**', './node_modules/**'],
    platforms: ['linux64', 'osx64', 'win64'],
    version: '0.12.3'
  })

  nw.on('log', console.log);

  nw.build().then(function(){
    console.log("all done!");

  }).catch(function(error){
    console.error(error);
  });
});
  gulp.src('assets/images/*')
    .pipe(imagemin({
      progressive: true,
      svgoPlugins: [{
        removeViewBox: false
      }],
      use: [jpegtran()]
    }))
    .pipe(gulp.dest('minified/images'));
});

gulp.task('clean', function(cb) {
  del(['minified/**'], cb);
});

gulp.task('tests', function(done) {
  return karma.start({
    configFile: __dirname + '/karma.conf.js',
    singleRun: true
  }, done);
});

gulp.task('deploy', function() {
  return gulp.src('./minified/**/*')
    .pipe(ghPages());
});

gulp.task('default', shell.task([
  'gulp clean && gulp minify && gulp deploy'
]));
Example #30
0
if (process.env.PRODUCTION) {
    production = true
}

gulp.task('js', function() {
    var onError = function(err) {
            console.log(err);
            this.end();
        };

    browserify({
        entries: ['./entry.js'],
        basedir: './assets/src/js'
    }).transform(envify).transform(reactify)
        .require('./entry', {expose: 'eventRender'})
        .require('underscore')
        .bundle()
        .on('error', onError)
        .pipe(source('tckt.js'))
        .pipe(ifElse(production, function() { return streamify(uglify()) }))
        .pipe(gulp.dest('./assets/compiled/'));
});

gulp.task('watch', function() {
    gulp.watch('./assets/src/js/**/*.js', ['js']);
});

gulp.task('server', shell.task("./manage.py runserver"));

gulp.task('default', ['watch', 'server']);