refactored for a simpler docs gulp file with reuse of aggregates now that it is possible

This commit is contained in:
Kevin Ross 2016-03-18 12:20:01 -05:00
parent c03e48f023
commit 9e7986a78d

View File

@ -40,7 +40,10 @@ const prefix = {task: {prefix: 'docs:'}}
export default function (gulp, options) {
let javascripts = parallel(gulp,
const js = new Aggregate(gulp, 'js',
series(gulp,
new EsLint(gulp, preset, prefix),
parallel(gulp,
new RollupIife(gulp, preset, prefix, options.rollupConfig, {
options: {
dest: 'docs.iife.js',
@ -53,30 +56,33 @@ export default function (gulp, options) {
options: {dest: 'docs-vendor.min.js'}
})
)
),
prefix)
let eslint = new EsLint(gulp, preset, prefix)
let scsslint = new ScssLint(gulp, preset, prefix, {
const css = new Aggregate(gulp, 'css',
series(gulp,
new ScssLint(gulp, preset, prefix, {
source: {glob: ['**/*.scss', '!docs.scss']},
watch: {glob: ['**/*.scss', '!docs.scss']}
})
let linters = parallel(gulp, scsslint, eslint)
let sass = new Sass(gulp, preset, prefix)
let recipes = series(gulp,
new Clean(gulp, preset, prefix),
linters,
sass,
javascripts,
}),
new Sass(gulp, preset, prefix),
new CssNano(gulp, preset, prefix)
)
),
prefix)
new Aggregate(gulp, 'default', recipes, prefix)
new Aggregate(gulp, 'lint', linters, prefix)
new Aggregate(gulp, 'js', series(gulp, eslint, javascripts), prefix)
new Aggregate(gulp, 'css', series(gulp, scsslint, sass), prefix)
const defaultRecipes = new Aggregate(gulp, 'default',
series(gulp,
new Clean(gulp, preset, prefix),
parallel(gulp,
css,
js
)
),
prefix)
// docs copy
new Aggregate(gulp, 'copy:bs-docs', parallel(gulp,
new Aggregate(gulp, 'copy:bs-docs',
parallel(gulp,
new Copy(gulp, preset, prefix, {
task: false, //{name: 'copy:bs-docs-content'},
source: {
@ -126,7 +132,8 @@ export default function (gulp, options) {
},
dest: 'docs/assets/js/vendor/'
}, prefix)
), prefix)
),
prefix)
return recipes
return defaultRecipes
}