Socket
Book a DemoInstallSign in
Socket

@kolibridev/gulp-tasks

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kolibridev/gulp-tasks

Collection of useful gulp tasks

0.11.10
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source

Gulp tasks

Collection of useful gulp tasks. WIP!

Usage

npm install @kolibridev/gulp-tasks

Example

Config

See gulpconfig-defaults for all default options. Usually something like this will suffice.

// ./gulp/config.js
const path = require('path')
const gutil = require('gulp-util')
const assign = require('lodash.assign')
const pkg = require('../package.json')

const config = {
  version: pkg.version,
  source: path.resolve(__dirname, '../src'),
  target: path.resolve(__dirname, '../dist'),
  minify: false,
  debug: true,
  url: 'https://dev.domain.com',
}

const envs = {
  prod: {
    minify: true,
    debug: false,
    url: 'https://www.domain.com',
  },
}

// Extend with environment specific config
const env = gutil.env.env || (gutil.env.prod ? 'prod' : 'dev')
assign(config, envs[env])

module.exports = config

Gulpfile

This can be directly in ./gulpfile.js or create something like ./gulp/index.js and require it in ./gulpfile.js

// ./gulpfile.js
require('./gulp')

This package exposes a function that optionally takes in your config. This example will register all the tasks for you. You can theoretically just register the tasks you're actually going to use. NOTE: If you create a local task (within your own project) with the same name as one of these, it will overwrite it's function.

// ./gulp/index.js
const gulp = require('gulp')
const gutil = require('gulp-util')
const _ = require('lodash')
const config = require('./config')

_.forOwn(require('@kolibridev/gulp-tasks')(config).tasks, (task) => {
  gutil.log(gutil.colors.green(`Registered ${gutil.colors.blue(task.name)} task`))
  gulp.task(task.name, task.dep, task.fn)
})

FAQs

Package last updated on 04 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.