Skip to content

Ability to load tasks from separate files #343

Description

@et

Does an equivalent to grunt.task.loadTasks(tasksPath) exist?

It would basically allow you to define tasks outside of a single file.

$ tree gulp/tasks
gulp/tasks
├── dev.js
├── release.js
└── test.js
gulp.loadTasks('gulp/tasks');

Activity

  1. yocontra commented on Mar 13, 2014

    @yocontra
    Member

    Use the require-dir module. In your task js files you can either call gulp.task(name, fn) or export fn then wire them up in your gulpfile

  2. et commented on Mar 14, 2014

    @et
    Author

    Wow thanks. The require-dir module was surprisingly easy.

  3. yocontra commented on Mar 14, 2014

    @yocontra
    Member

    @et If you want to submit a recipe for the docs that would be cool

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