Created
January 18, 2017 17:24
-
-
Save clovisdasilvaneto/28874e5b957bbe384ce27417a82daba8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const gulp = require('gulp'), | |
notify = require("gulp-notify"), | |
uglify = require('gulp-uglify'), | |
concat = require('gulp-concat'); | |
let config = { | |
jsPath: './js/modules', | |
jsCompressPath: './js/build/compress', | |
sassPath: './scss', | |
tomcat: '/Users/clovisneto/Liferay/SIGEX/liferay-portal-6.2-ee-sp13/tomcat-7.0.62/', | |
themeFolder: 'webapps/sigex-theme' | |
} | |
gulp.task('compress', function() { | |
return gulp.src(config.jsPath +'/*.js') | |
.pipe(uglify()) | |
.pipe(gulp.dest(config.jsCompressPath)) | |
.pipe(gulp.dest(config.tomcat + config.themeFolder + '/js/build/compress')).on('end', function(){ | |
gulp.src(config.jsCompressPath +'/*.js').pipe(concat('main.js')) | |
.pipe(gulp.dest('./js/build')) | |
.pipe(gulp.dest(config.tomcat + config.themeFolder + '/js/build/')) | |
.pipe(notify("Javascript OK!")); | |
}) | |
}); | |
// Rerun the task when a file changes | |
gulp.task('watch', function() { | |
gulp.watch(config.jsPath + '/**/*.js', ['compress']); | |
}); | |
gulp.task('default', ['compress','watch']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment