Defining useful additionalTasks is extremely confusing
See original GitHub issueThe additionalTasks
documentation doesn’t actually define any useful real-world tasks, such as simply copying files from one directory to another. I tried adding a task that does this to my initialize
function, and then running it as part of my prebuild
step:
additionalTasks: {
initialize(gulp, PATH_CONFIG, TASK_CONFIG) {
gulp.task('copy-package-json', () => {
return gulp.src('./package.json')
.pipe(gulp.dest('./public/'));
});
},
development: {
prebuild: ['copy-package-json'],
postbuild: [],
},
production: {
prebuild: [],
postbuild: [],
}
}
The copy-package-json
task executes when I run blendid
but it doesn’t seem to copy the package.json
file in the root directory of my project into the public
directory. I thought perhaps this might be because my public
directory is being wiped after the prebuild
tasks execute, so I moved the task to postbuild
, but then the task doesn’t seem to get run at all (in fact, blendid
only runs the default
and clean
tasks when I do this, whereas it runs a bunch of tasks when I put copy-package-json
in prebuild
).
I recommend modifying the documentation so that at least one useful task is defined, so that readers have a better mental model for how to leverage additionalTasks
for their needs.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:6 (4 by maintainers)
Top GitHub Comments
@cbje-tokyo couple of options I can think of.
blendid build
and then set up a completely separate gulp task for your sitemap and run it against the directory to see if it works. This can rule out any issues with the sitemap extension itself.Cheers
@toolness I set this GIST up with a useful(ish) additional task that copies a
.liquid
extended version ofapp.css
over toassets
for Shopify.https://gist.github.com/dillonbailey/c06b1ee88ab1432435515c65840daf74