How to use the gulp.pkg function in gulp

To help you get started, we’ve selected a few gulp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gooy / aurelia-smooth-scroll / build / tasks / deploy.js View on Github external
var gulp = require('gulp');
var runSequence = require('run-sequence').use(gulp);
var ghPages = require('gulp-gh-pages');
var dirs = gulp.pkg.directories;

/**
 * Clean the dist directory first then build the files.
 */
gulp.task('deploy', function(done) {
  return runSequence(
    'demo-deploy',
    'demo-deploy-filter',
    done
  );
});

// upload the deploy directory to gh-pages branch
gulp.task('deploy-gh-pages', function() {
  return gulp.src([dirs.deploy+'/**/*'])
  .pipe(ghPages({push:true}));
github gooy / js-deco / build / tasks / build.js View on Github external
var gulp = require('gulp');
var runSequence = require('run-sequence').use(gulp);
var changed = require('gulp-changed');
var plumber = require('gulp-plumber');
var babel = require('gulp-babel');
var sourcemaps = require('gulp-sourcemaps');
var compilerOptions = require('../babel-options');
var assign = Object.assign || require('object.assign');
var del = require('del');
var fs = require('graceful-fs');
var mkdirp = require('mkdirp');
var vinylPaths = require('vinyl-paths');
var ncp = require('ncp').ncp;
var dirs = gulp.pkg.directories;

/**
 * Transpile es6 code into the dist directory as systemjs
 */
gulp.task('build-system', function () {
  return gulp.src(dirs.lib+"/**/*.js")
  .pipe(sourcemaps.init())
  .pipe(babel(assign({}, compilerOptions, {modules:'system'})))
  .pipe(sourcemaps.write("."))
  .pipe(gulp.dest(dirs.build + '/system'));
});

gulp.task('build-es6', function () {
  return gulp.src(dirs.lib+"/**/*.js")
  .pipe(gulp.dest(dirs.build + '/es6'));
});
github gooy / aurelia-animator-velocity / build / tasks / demo / build.js View on Github external
var gulp = require('gulp');
var runSequence = require('run-sequence');
var changed = require('gulp-changed');
var copy = require('gulp-copy');
var plumber = require('gulp-plumber');
var babel = require('gulp-babel');
var fs = require('graceful-fs');
var fse = require('fs-extra');
var sourcemaps = require('gulp-sourcemaps');
var compilerOptions = require('../../babel-options');
var assign = Object.assign || require('object.assign');
var glob = require('glob');
var del = require('del');
var vinylPaths = require('vinyl-paths');

var dirs = gulp.pkg.demo.directories;
var _dirs = gulp.pkg.directories;

/**
 * Transpile es6 code into the dist directory
 */
gulp.task('demo-build-system', function () {
  return gulp.src(dirs.lib+"/app/**/*.js")
  .pipe(plumber())
  //.pipe(changed(dirs.build, {extension: '.js'}))
  .pipe(sourcemaps.init())
  .pipe(babel(assign({}, compilerOptions, {modules:'system'})))
  .pipe(sourcemaps.write("."))
  .pipe(gulp.dest(dirs.build+"/app"));
});

/**
github gooy / aurelia-animator-velocity / build / tasks / git.js View on Github external
gulp.task('git-remote-add', function(){
  git.addRemote('origin', 'https://github.com/gooy/'+gulp.pkg.name, function (err) {
    if (err) throw err;
  });
});
github gooy / aurelia-smooth-scroll / build / tasks / demo / deploy.js View on Github external
var gulp   = require('gulp');
var glob   = require('glob');
var fse   = require('fs-extra');
var fs   = require('fs');
var runSequence = require('run-sequence');

var _dirs = gulp.pkg.directories;
var dirs = gulp.pkg.demo.directories;

/**
 * Copy all files from dist to the deploy directory
 */
gulp.task('demo-deploy-copy', function() {
  fse.copySync(dirs.build,dirs.deploy);
});


gulp.task('demo-deploy-filter', function(done) {
  var patterns = [
    dirs.deploy+"/app/**/*.js",
    dirs.deploy+"/app/**/*.map"
  ];
  removeAll(patterns,{
github gooy / aurelia-animator-velocity / build / tasks / demo / deploy.js View on Github external
var gulp   = require('gulp');
var glob   = require('glob');
var fse   = require('fs-extra');
var fs   = require('fs');
var runSequence = require('run-sequence');

var _dirs = gulp.pkg.directories;
var dirs = gulp.pkg.demo.directories;

/**
 * Copy all files from dist to the deploy directory
 */
gulp.task('demo-deploy-copy', function() {
  fse.copySync(dirs.build,dirs.deploy);
});


gulp.task('demo-deploy-filter', function(done) {
  var patterns = [
    dirs.deploy+"/app/**/*.js",
    dirs.deploy+"/app/**/*.map"
  ];
  removeAll(patterns,{
github gooy / aurelia-animator-velocity / build / tasks / demo / bundle.js View on Github external
var gulp = require('gulp');
var jspm = require('jspm');
var fs = require('fs');
var shell = require('child-process-promise');
var filesize = require('filesize');
var gzipSize = require('gzip-size');
var uglify = require('gulp-uglify');

var dirs = gulp.pkg.demo.directories;

/**
 * Bundle aurelia-framework
 */
gulp.task('demo-bundle', function (done) {

  var distFile = 'aurelia.js';
  var outputFile = dirs.build+'/app/' + distFile;

  var cmd = [
    'aurelia-bootstrapper',
    'aurelia-http-client',
    'aurelia-dependency-injection',
    'aurelia-framework',
    'aurelia-router',
    'npm:core-js',
github gooy / js-deco / gulpfile.js View on Github external
require('gulp').pkg = require("./defaults").pkg;
require("require-dir")("build/tasks");
github gooy / js-deco / build / tasks / build.js View on Github external
gulp.task('clean-dist', function() {
  return gulp.src([gulp.pkg.directories.build])
  .pipe(vinylPaths(del));
});
github gooy / aurelia-animator-velocity / build / tasks / demo / watch.js View on Github external
var gulp = require('gulp');
var fs = require('fs');
var browserSync = require('browser-sync');

var dirs = gulp.pkg.demo.directories;

/**
 * Watch files for changes and transpile/copy then to the dist direcotry during development.
 */
gulp.task('demo-watch', ['demo-serve'], function() {

  gulp.watch(gulp.pkg.directories.lib+"/**/*.js", ['jspm-link', browserSync.reload]).on('change', reportChange);
  gulp.watch(gulp.pkg.directories.lib+"/**/*.html", ['jspm-link', browserSync.reload]).on('change', reportChange);

  //app files
  gulp.watch(dirs.lib+"/**/*.js", ['demo-build-system', browserSync.reload]).on('change', reportChange);
  gulp.watch(dirs.lib+"/**/*.html", ['demo-build-html', browserSync.reload]).on('change', reportChange);

  //root files
  gulp.watch(dirs.lib+"/index.html", ['demo-build-root', browserSync.reload]).on('change', reportChange);
  gulp.watch("config.js", ['demo-build-root',browserSync.reload]).on('change', reportChange);