We have a bunch of applications sharing common gulp logic, so we made a gulp plugin that contains a bunch of custom tasks.
However we'd like to avoid installing gulp+our plugin (along with half the internet) for each of the applications we develop.
Ideally, I'd like to do:
npm install -g gulp
npm install -g <our gulp plugin>
npm link gulp
npm link <our gulp plugin>
[15:16:51] Using gulpfile /workspace/my-app/gulpfile.js
[15:16:51] Task 'dev' is not in your gulpfile
[15:16:51] Please check the documentation for proper gulpfile formatting
var gulp = require('gulp');
var mygulpplugin = require('mygulpplugin');
Figured it out. Added the following line at the bottom of my module:
module.exports = gulp;
And my gulpfile in each module looks like this:
var gulp = require('gulp'); var mygulpplugin = require('mygulpplugin'); gulp.tasks = mygulpplugin.tasks;