#35 Added manifests to gulpfile
This commit is contained in:
parent
98153e229b
commit
104bb4eae7
18
gulpfile.js
18
gulpfile.js
|
@ -15,6 +15,7 @@ Base consts
|
||||||
// Project sources
|
// Project sources
|
||||||
const src = {
|
const src = {
|
||||||
root: 'src',
|
root: 'src',
|
||||||
|
manifests: 'src/manifests',
|
||||||
styles: 'src/stylesheets',
|
styles: 'src/stylesheets',
|
||||||
scripts: 'src/javascript',
|
scripts: 'src/javascript',
|
||||||
images: 'src/images',
|
images: 'src/images',
|
||||||
|
@ -23,6 +24,7 @@ const src = {
|
||||||
// Build path
|
// Build path
|
||||||
const tmp = {
|
const tmp = {
|
||||||
root: '.tmp',
|
root: '.tmp',
|
||||||
|
manifests: '.tmp/manifests',
|
||||||
styles: '.tmp/stylesheets',
|
styles: '.tmp/stylesheets',
|
||||||
scripts: '.tmp/javascript',
|
scripts: '.tmp/javascript',
|
||||||
images: '.tmp/images',
|
images: '.tmp/images',
|
||||||
|
@ -33,6 +35,7 @@ const tmp = {
|
||||||
// Dist path
|
// Dist path
|
||||||
const dist = {
|
const dist = {
|
||||||
root: 'dist',
|
root: 'dist',
|
||||||
|
manifests: 'dist/manifests',
|
||||||
styles: 'dist/stylesheets',
|
styles: 'dist/stylesheets',
|
||||||
scripts: 'dist/javascript',
|
scripts: 'dist/javascript',
|
||||||
images: 'dist/images',
|
images: 'dist/images',
|
||||||
|
@ -110,10 +113,21 @@ gulp.task('images', () => {
|
||||||
$.imagemin.optipng(),
|
$.imagemin.optipng(),
|
||||||
$.imagemin.svgo({ plugins: [{ cleanupIDs: false }] })
|
$.imagemin.svgo({ plugins: [{ cleanupIDs: false }] })
|
||||||
]))
|
]))
|
||||||
.pipe($.size({ title: 'images' }))
|
.pipe($.size({
|
||||||
|
showFiles: true,
|
||||||
|
}))
|
||||||
.pipe(gulp.dest(tmp.images))
|
.pipe(gulp.dest(tmp.images))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
gulp.task('manifests', () => {
|
||||||
|
return gulp.src(`${src.manifests}/**/*.json`)
|
||||||
|
.pipe($.plumber())
|
||||||
|
.pipe($.size({
|
||||||
|
showFiles: true,
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest(tmp.manifests))
|
||||||
|
})
|
||||||
|
|
||||||
/* ============================================================================
|
/* ============================================================================
|
||||||
Clean
|
Clean
|
||||||
============================================================================ */
|
============================================================================ */
|
||||||
|
@ -128,7 +142,7 @@ gulp.task('clean', gulp.series('clean:build', 'clean:dist'))
|
||||||
BUILD CLEAN ALL
|
BUILD CLEAN ALL
|
||||||
============================================================================ */
|
============================================================================ */
|
||||||
|
|
||||||
gulp.task('build', gulp.series('clean:build', 'images', 'scripts', 'styles'));
|
gulp.task('build', gulp.series('clean:build', 'manifests', 'images', 'scripts', 'styles'));
|
||||||
|
|
||||||
/* ============================================================================
|
/* ============================================================================
|
||||||
DIST CLEAN ALL
|
DIST CLEAN ALL
|
||||||
|
|
Loading…
Reference in a new issue