Created
September 17, 2017 18:40
-
-
Save elton182/17edf28882d31ac1946db90ed09e65a1 to your computer and use it in GitHub Desktop.
Gulp File para compilar os assets no cake
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
var gulp = require('gulp'); | |
var uglify = require('gulp-uglify'); | |
var cssnano = require('gulp-cssnano'); | |
var copy = require('gulp-copy'); | |
gulp.task('minify-js', function () { | |
gulp.src('webroot/src/js/**/*.js') | |
.pipe(uglify()) | |
.pipe(gulp.dest('webroot/js')); | |
}); | |
gulp.task('minify-css', function () { | |
gulp.src('webroot/src/css/**/*.css') | |
.pipe(cssnano({safe: true})) | |
.pipe(gulp.dest('webroot/css')); | |
}); | |
gulp.task('copy-fonts', function (){ | |
var options = {prefix: 4}; | |
gulp.src('webroot/src/css/fontawesome/fonts/**') | |
.pipe(copy('webroot/css/fontawesome/fonts/',options)); | |
gulp.src('webroot/src/css/contextmenu/font/**') | |
.pipe(copy('webroot/css/contextmenu/font/',options)); | |
}); | |
gulp.task('copy-img', function (){ | |
var options = {prefix: 4}; | |
gulp.src('webroot/src/css/jstree/*.gif') | |
.pipe(copy('webroot/css/jstree/',options)); | |
gulp.src('webroot/src/css/jstree/*.png') | |
.pipe(copy('webroot/css/jstree/',options)); | |
}); | |
gulp.task('default', ['minify-js', 'minify-css','copy-fonts','copy-img']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment