blendid icon indicating copy to clipboard operation
blendid copied to clipboard

Additional Tasks information

Open codyellingham opened this issue 7 years ago • 4 comments

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)

codyellingham avatar Sep 22 '18 05:09 codyellingham

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

yannou788 avatar Sep 22 '18 21:09 yannou788

@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,
    }
  }

codyellingham avatar Sep 23 '18 03:09 codyellingham

@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']
    }
  }

yannou788 avatar Sep 24 '18 08:09 yannou788

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 avatar May 28 '19 22:05 olets