Skip to content

Commit

Permalink
Add a config flag to control partials generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
thusc committed Nov 27, 2021
1 parent 73269fb commit f789b13
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
7 changes: 6 additions & 1 deletion core/discovery/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const defaultConfig = {
pageTree: {
layoutStyle: 'sidebar'
},
/**
* Partials generation: this flag determines
* whether the components partials get generated
*/
partials: false,
/**
* CSS and JS minification
* Adjust these values to set up your project for production or dev
Expand Down Expand Up @@ -86,4 +91,4 @@ const defaultConfig = {
},
};

module.exports = defaultConfig;
module.exports = defaultConfig;
17 changes: 8 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@ gulp.task('templates:compile:partials', templates.compile.partials);
gulp.task('templates:compile:styleguide', templates.compile.styleguide);
gulp.task('templates:compile:docs', templates.compile.docs);

gulp.task(
'templates:compile',
config.styleguide ?
gulp.parallel(
'templates:compile:content', 'templates:compile:partials',
'templates:compile:styleguide', 'templates:compile:docs') :
gulp.parallel(
'templates:compile:content', 'templates:compile:partials')
);
var compileTasks = ['templates:compile:content'];
if (config.partials) {
compileTasks.push('templates:compile:partials');
}
if (config.styleguide) {
compileTasks.push('templates:compile:styleguide', 'templates:compile:docs');
}
gulp.task('templates:compile', gulp.parallel(...compileTasks));

gulp.task('watch', watch);
gulp.task('copy', gulp.parallel('copy:images', 'copy:fonts', 'copy:resources', 'copy:scripts', 'copy:favicon'));
Expand Down

0 comments on commit f789b13

Please sign in to comment.