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

How to overwrite tasks? #42

Open
maxklenk opened this issue Nov 2, 2015 · 2 comments
Open

How to overwrite tasks? #42

maxklenk opened this issue Nov 2, 2015 · 2 comments

Comments

@maxklenk
Copy link
Member

maxklenk commented Nov 2, 2015

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?

@sebastianhenneberg
Copy link
Contributor

Where exactly are the import of gulp-modular and the initial call of gulp-modular located?

@maxklenk
Copy link
Member Author

maxklenk commented Nov 3, 2015

They have been further up the file, my overwrite was located at the very end of the gulpfile.js.

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

2 participants