Additional Tasks information
codyellingham opened this issue · 4 comments
In the FAQ:
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)
This is the good url https://github.com/vigetlabs/blendid/wiki/Configuration#alternatetask
@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,
}
}
@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']
}
}
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?