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

Where are the gulp tasks? #30

Closed
kunalkankariya opened this issue Sep 18, 2019 · 3 comments
Closed

Where are the gulp tasks? #30

kunalkankariya opened this issue Sep 18, 2019 · 3 comments

Comments

@kunalkankariya
Copy link

This is a question and not an issue

The gulpfile.js doesn't list the tasks individually. So, where are they defined? and how does gulp know what to do when I say gulp push for instance. I know the npm scripts invokes this but where is the definition for gulp push ( I know its spsave under the hood).

Thanks!

@koltyakov
Copy link
Owner

There are plenty of tasks spread throught the different modules. All they are defined in sp-build-tasks and registered in gulpfile.js:

new (require('sp-build-tasks').SPBuildTasks)(gulp, {
  privateConf: process.env.PRIVATE_JSON || './config/private.json',
  appConfig: process.env.APP_JSON || './config/app.json',
  taskPath: process.env.TASKS_PATH || './tools/tasks'
});

Also, you can define custom tasks. When scaffolding, there is the corresponding option. Which adds example.js in ./tools/tasks folder.

//@ts-check

const { customTask } = require('sp-build-tasks');

module.exports = customTask((gulp, $, settings) => {

  gulp.task('example', cb => {
    console.log('Example Gulp Task');
    cb();
  });

});

Hope you got the idea.

@koltyakov
Copy link
Owner

Going to close it.

@kunalkankariya
Copy link
Author

Thank you so much :)

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