Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Additional Tasks information #564

Open
codyellingham opened this issue Sep 22, 2018 · 4 comments
Open

Additional Tasks information #564

codyellingham opened this issue Sep 22, 2018 · 4 comments
Assignees

Comments

@codyellingham
Copy link

codyellingham commented Sep 22, 2018

In the FAQ:

screen shot 2018-09-22 at 13 02 33

The "Additional Tasks" link does not work, where can I find more information how to use this please?
I would like to add Sitemap task. (https://yarnpkg.com/en/package/sitemap#example-of-pre-generating-sitemap-based-on-existing-static-files)

@yannou788
Copy link

This is the good url https://github.com/vigetlabs/blendid/wiki/Configuration#alternatetask

@codyellingham
Copy link
Author

@yannou788 Thank you, how would you add a task for a new task, such as a sitemap maker? This is what I have, it runs the task but nothing is generated.

  additionalTasks: {
    initialize(gulp, PATH_CONFIG, TASK_CONFIG) {

      gulp.task('sitemap', function () {
          gulp.src('./public/**/*.html', {
                  read: false
              })
              .pipe(sitemap({
                  siteUrl: 'http://example.com'
              }))
              .pipe(gulp.dest('./public'));
      });
    },
     development: {
      prebuild: null,
      postbuild: ['sitemap'],
    },
    production: {
      prebuild: null,
      postbuild: null,
    }
  }

@yannou788
Copy link

@cbje-tokyo Hi, maybe it's your src path that's not good sometime it's happen, and try this :

    initialize(gulp, PATH_CONFIG, TASK_CONFIG) {

      gulp.task('sitemap', function () {
          gulp.src('./public/**/*.html', {
                  read: false
              })
              .pipe(sitemap({
                  siteUrl: 'http://example.com'
              }))
              .pipe(gulp.dest('./public'));
      });
    },
    production: {
      postbuild: ['sitemap']
    }
  }

@olets
Copy link
Contributor

olets commented May 28, 2019

I would add that you can accesses values set in task-config.js and path-config.json with TASK_CONFIG.<option> and PATH_CONFIG.<option>.

@cbje-tokyo did you solve this?

@olets olets self-assigned this May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants