How to fix “Task is not in your gulpfile” error when using npm link?

后端 未结 2 931
时光说笑
时光说笑 2021-02-13 18:25

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+o

2条回答
  •  我寻月下人不归
    2021-02-13 19:28

    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;
    

提交回复
热议问题