-
-
Save muhamed-didovic/0469a12040b08efef4db to your computer and use it in GitHub Desktop.
Revisions
-
lukepolo revised this gist
Mar 13, 2015 . 2 changed files with 122 additions and 97 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,97 +0,0 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,122 @@ var gulp = require('gulp'), compass = require('gulp-compass'), gutil = require('gulp-util'), chalk = require('chalk'), concat = require('gulp-concat'), uglify = require('gulp-uglify'), imagemin = require('gulp-imagemin'), pngquant = require('imagemin-pngquant'), elixir = require('laravel-elixir'), bower_path = './vendor/bower_components/', resources_path = './resources/'; paths = { 'css_public': './public/assets/css/', 'js_public' : './public/assets/js/', 'fonts_public' : './public/assets/fonts/', 'sass': resources_path+'assets/sass/', 'img': resources_path+'assets/img/', 'js' : resources_path+'assets/js/', 'jquery' : bower_path + "jquery/dist/", 'bootstrap' : bower_path + "bootstrap-sass-official/assets/", 'fontawesome' : bower_path + "fontawesome/" }; // Minify JS elixir.extend("minify_js", function() { gulp.task('minify_js', function() { gulp.src([ paths.js+ 'prettify/prettify.js', paths.js+ '**', paths.bootstrap + 'javascripts/bootstrap.min.js' ], { base: './' }) .pipe(concat('all.js')) .pipe(uglify()) .pipe(gulp.dest('public/assets/js')); }); if(command == 'watch') { gutil.log('Starting', '\'' + chalk.cyan('watch-js') + '\'...'); return this.registerWatcher("minify_js", resources_path+"**/*.js"); } else { return this.queueTask("minify_js"); } }); // Minify CSS elixir.extend("minify_css", function() { gulp.task('minify_css', function() { gulp.src([paths.sass+'*']) .pipe(compass({ css: paths.css_public, sass: paths.sass, image: paths.img, logging : false, comments : false, style : 'expanded' })) .pipe(gulp.dest('public/assets/css')) }); if(command == 'watch') { gutil.log('Starting', '\'' + chalk.cyan('watch-sass') + '\'...'); return this.registerWatcher("minify_css", resources_path+"**/*.scss"); } else { return this.queueTask("minify_css") } }); // Minify Images elixir.extend("minify_img", function(command) { gulp.task('minify_img', function() { gulp.src(paths.img+'*') .pipe(imagemin({ progressive: true, svgoPlugins: [{removeViewBox: false}], use: [pngquant()] })) .pipe(gulp.dest('public/assets/img')); }); if(command == 'watch') { gutil.log('Starting', '\'' + chalk.cyan('watch-images') + '\'...'); return this.registerWatcher("minify_js", resources_path+"**/*.js"); return this.registerWatcher("minify_img", paths.img+'*'); } else { return this.queueTask("minify_img"); } }); elixir(function (mix) { command = process.argv.slice(2)[0]; gutil.log('Command:', '\'' + chalk.cyan(command) + '\'...'); // Copy Assets from Vendors mix.copy(paths.jquery + 'jquery.min.js', paths.js_public+'jquery.min.js') .copy(paths.jquery + 'jquery.min.map', paths.js_public+'jquery.min.map') .copy(paths.fontawesome + '/fonts', paths.fonts_public) .minify_js(command) .minify_css(command) .minify_img(command); }); -
lukepolo revised this gist
Mar 12, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -60,7 +60,7 @@ elixir.extend("minify_css", function() .pipe(gulp.dest('public/assets/css')) }); this.registerWatcher("minify_css", "**/*.scss"); return this.queueTask("minify_css"); }); -
lukepolo created this gist
Mar 12, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,97 @@ var gulp = require('gulp'), compass = require('gulp-compass'), gutil = require('gulp-util'), chalk = require('chalk'), concat = require('gulp-concat'), uglify = require('gulp-uglify'), imagemin = require('gulp-imagemin'), pngquant = require('imagemin-pngquant'), elixir = require('laravel-elixir'), bower_path = './vendor/bower_components/', paths = { 'sass': './resources/assets/sass/', 'css': './public/assets/css/', 'img': './resources/assets/img/', 'js' : './resources/assets/js/', 'jquery' : bower_path + "jquery/dist/", 'bootstrap' : bower_path + "bootstrap-sass-official/assets/", 'fontawesome' : bower_path + "fontawesome/" }; // Minify JS elixir.extend("minify_js", function() { gulp.task('minify_js', function() { gutil.log('Changes Found :', '\'' + chalk.cyan('Scripts') + '\'...'); gulp.src([ paths.js+ 'prettify/prettify.js', paths.js+ '**', paths.bootstrap + 'javascripts/bootstrap.min.js' ], { base: './' }) .pipe(concat('all.js')) .pipe(uglify()) .pipe(gulp.dest('public/assets/js')); }); this.registerWatcher("minify_js", "**/*.js"); return this.queueTask("minify_js"); }); // Minify CSS elixir.extend("minify_css", function() { gulp.task('minify_css', function() { gutil.log('Changes Found :', '\'' + chalk.cyan('SASS') + '\'...'); gulp.src([paths.sass+'*']) .pipe(compass({ css: paths.css, sass: paths.sass, image: paths.img, logging : false, comments : false, style : 'expanded' })) .pipe(gulp.dest('public/assets/css')) }); this.registerWatcher("minify_css", "**/*.sass"); return this.queueTask("minify_css"); }); // Minify Images elixir.extend("minify_img", function() { gulp.task('minify_img', function() { gutil.log('Changes Found :', '\'' + chalk.cyan('Images') + '\'...'); return gulp.src(paths.img+'*') .pipe(imagemin({ progressive: true, svgoPlugins: [{removeViewBox: false}], use: [pngquant()] })) .pipe(gulp.dest('public/assets/img')); }); this.registerWatcher("minify_css", paths.img+'*'); return this.queueTask("minify_img"); }); elixir(function (mix) { // Copy Assets from Vendors mix.copy(paths.jquery + 'jquery.min.js', "public/assets/js/jquery.min.js"); mix.copy(paths.fontawesome + '/fonts', 'public/assets/fonts'); // Minify Assetes mix.minify_js(); mix.minify_css(); mix.minify_img(); });