Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. "use strict";
  2.  
  3. const gulp = require('gulp'),
  4. notify = require("gulp-notify"),
  5. uglify = require('gulp-uglify'),
  6. concat = require('gulp-concat');
  7.  
  8. let config = {
  9. jsPath: './js/modules',
  10. jsCompressPath: './js/build/compress',
  11. sassPath: './scss',
  12. tomcat: '/Users/clovisneto/Liferay/SIGEX/liferay-portal-6.2-ee-sp13/tomcat-7.0.62/',
  13. themeFolder: 'webapps/sigex-theme'
  14. }
  15.  
  16. gulp.task('compress', function() {
  17. return gulp.src(config.jsPath +'/*.js')
  18. .pipe(uglify())
  19. .pipe(gulp.dest(config.jsCompressPath))
  20. .pipe(gulp.dest(config.tomcat + config.themeFolder + '/js/build/compress')).on('end', function(){
  21. gulp.src(config.jsCompressPath +'/*.js').pipe(concat('main.js'))
  22. .pipe(gulp.dest('./js/build'))
  23. .pipe(gulp.dest(config.tomcat + config.themeFolder + '/js/build/'))
  24. .pipe(notify("Javascript OK!"));
  25. })
  26. });
  27.  
  28. // Rerun the task when a file changes
  29. gulp.task('watch', function() {
  30. gulp.watch(config.jsPath + '/**/*.js', ['compress']);

  31. });
  32.  
  33. gulp.task('default', ['compress','watch']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement