Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "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']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement