From ac5c3fe6e7fe026a6ea464dc08a5dc169166b8dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Victor=20Tozatti=20Risso?= <jvtr12@inf.ufpr.br>
Date: Tue, 22 Nov 2016 11:46:24 -0200
Subject: [PATCH] Separate compilation tasks from copy tasks when building the
 project
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- Move copying required files (e.g. config.json) into the 'build' gulp task
- Leave compilation task only for compilation of sources files

Signed-off-by: João Victor Tozatti Risso <jvtr12@inf.ufpr.br>
---
 gulpfile.babel.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gulpfile.babel.js b/gulpfile.babel.js
index f9436ee9..e732dc6b 100644
--- a/gulpfile.babel.js
+++ b/gulpfile.babel.js
@@ -47,16 +47,17 @@ gulp.task('compile', ['lint'], () => {
     .pipe(babel())      // compile only modified files
     // .pipe(cache.cache())        // cache compiled files
     .pipe(gulp.dest('build'));  // move compiled files to build directory
+});
 
+gulp.task('build', ['compile'], () => {
+    var filesToCopy = [ 'config.json', 'package.json' ];
     // copy configuration file to build directory
-    gulp.src('config.json')
+    gulp.src(filesToCopy)
     .pipe(gulp.dest('build'));
 
     createLogDir();
 });
 
-gulp.task('build', ['compile']);
-
 gulp.task('docco', () => {
     gulp.src('./src/**/*.js')
         .pipe(docco())
-- 
GitLab