Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespacing? #67

Open
Qard opened this issue Mar 27, 2015 · 0 comments
Open

Namespacing? #67

Qard opened this issue Mar 27, 2015 · 0 comments

Comments

@Qard
Copy link

Qard commented Mar 27, 2015

I often see modules using gulp which manually define namespaces of sorts in their task names.

gulp.task('build:css', function () {
  // do stuff
})

Perhaps a namespace function could be defined, which scopes all add calls, applying the namespace as a prefix.

gulp.namespace('build', function () {
  gulp.task('css', function () {
    // do stuff
  })
})

This example looks a bit verbose, but a nice side-effect is that the namespacing is detached from the task naming, so you can do things like load dependency gulp tasks into your own gulpfile, under a convenient namespace where it won't interfere with other things.

gulp.namespace('some-dependency', function () {
  require('some-dependency/gulpfile')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant