From a3b02f6743618dd62dadd58406ccf788e762ea39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Ko=CC=88nemann?= Date: Fri, 27 Jan 2017 18:31:54 +0100 Subject: [PATCH] Adding a dist-product task and a cleanup task before dist --- .gitignore | 2 ++ gulpfile.js | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 35aa3a5..954d01a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ understrap.zip dist +dist-product + diff --git a/gulpfile.js b/gulpfile.js index dafb3c4..44c616c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -223,8 +223,25 @@ gulp.task('copy-assets', ['clean-source'], function() { // Run // gulp dist // Copies the files to the /dist folder for distributon -gulp.task('dist', function() { - gulp.src(['**/*','!bower_components','!bower_components/**','!node_modules','!node_modules/**','!src','!src/**','!dist','!dist/**', '*']) +gulp.task('dist', ['clean-dist'], function() { + gulp.src(['**/*','!bower_components','!bower_components/**','!node_modules','!node_modules/**','!src','!src/**','!dist','!dist/**','!sass','!sass/**','!readme.txt','!readme.md','!package.json','!gulpfile.js','!CHANGELOG.md','!.travis.yml','!jshintignore', '!codesniffer.ruleset.xml', '*']) .pipe(gulp.dest('dist/')) }); +// Deleting any file inside the /src folder +gulp.task('clean-dist', function () { + return del(['dist/**/*',]); +}); + +// Run +// gulp dist-product +// Copies the files to the /dist folder for distributon +gulp.task('dist-product', ['clean-dist-product'], function() { + gulp.src(['**/*','!bower_components','!bower_components/**','!node_modules','!node_modules/**','!src','!src/**','!dist','!dist/**', '*']) + .pipe(gulp.dest('dist-product/')) +}); + +// Deleting any file inside the /src folder +gulp.task('clean-dist-product', function () { + return del(['dist-product/**/*',]); +});