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