Skip to content

How to require plugins between different task files just ones #742

Description

@zot24

I want to do what is explained on this issue #345 however I'm not sure how don't DRY when requiring the same plugin on different files e.g gulp = require 'gulp'

Related to #345

Activity

  1. safareli commented on Oct 24, 2014

    @safareli

    FILE gulp/index.coffee

    gulp = require('gulp')
    plugins = require('gulp-load-plugins')()
    config =
      buildDir:'./build'
    for name, task of requireDir('tasks')
      task(gulp,plugins,config)
    

    FILE gulp/tasks/clean.coffee

    module.exports = (gulp, plugins, config)->
      gulp.task 'clean', ()->
        return gulp
          .src(config.buildDir, read: false)
          .pipe(plugins.clean())
    

    you can check my last project where i used same way for splitting gulp tasks uniHackge/unihack.ge

  2. zot24 commented on Oct 24, 2014

    @zot24
    Author

    Thanks @safareli! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions