Skip to content

How to overwrite tasks? #42

Open
Open
@maxklenk

Description

@maxklenk

I tried to overwrite a task by adding something like this to my local gulpfile.js:

// OVERWRITE: custom index task
var extend = require('extend'),
  gulpInject = require('gulp-inject'),
  minifyInline = require('gulp-minify-inline'),
  minifyHtml = require('gulp-minify-html'),
  preprocess = require('gulp-preprocess'),
  _ = require('underscore');

function customtIndex(gulp, config) {
  function injectIndex() {
   ...
  }

  gulp.task('index', tasks, injectIndex);
}

customtIndex(gulp, config);

Multiple problems result of doing so:

  • Dependencies which are only specified in gulp-modular will be installed in node_modules/gulp-modular/node_modules and therefore can't be imported with require().
  • I can pass the local config file, but it was not yet merged with the default config, so some keys are missing.

How to do it better?

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