Created
January 28, 2014 10:49
-
-
Save theand/8665534 to your computer and use it in GitHub Desktop.
gulp setting for my laravel app assets.
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 minifycss = require('gulp-minify-css'); | |
| var concat = require('gulp-concat'); | |
| var rename = require('gulp-rename'); | |
| var uglify = require('gulp-uglify'); | |
| gulp.task('css-compress', function(){ | |
| gulp.src( | |
| [ | |
| 'assets/stylesheets/vendor/colorbox.css', | |
| 'assets/stylesheets/vendor/ui-lightness/jquery-ui.css', | |
| 'assets/stylesheets/vendor/dough-0.2.0.css', | |
| 'assets/stylesheets/main.css', | |
| 'assets/stylesheets/login.css', | |
| 'assets/stylesheets/pagination.css' | |
| ] | |
| ) | |
| .pipe( concat('app.css') ) | |
| .pipe( gulp.dest('public/assets/css') ) | |
| .pipe(rename('app.min.css')) | |
| .pipe( minifycss() ) | |
| .pipe( gulp.dest('public/assets/css') ); | |
| }); | |
| gulp.task('js-compress', function() { | |
| gulp.src( | |
| [ | |
| 'assets/javascripts/vendor/jquery.colorbox.js', | |
| 'assets/javascripts/vendor/jquery.noty.js', | |
| 'assets/javascripts/vendor/default.js', | |
| 'assets/javascripts/vendor/topCenter.js', | |
| 'assets/javascripts/vendor/jquery-ui.min.js', | |
| 'assets/javascripts/vendor/jquery.ui.datepicker-ko.js', | |
| 'assets/javascripts/vendor/jquery.mtz.monthpicker.js', | |
| 'assets/javascripts/vendor/dough-script-0.2.0.js', | |
| 'assets/javascripts/vendor/Chart.js', | |
| 'assets/javascripts/plugins.js', | |
| 'assets/javascripts/main.js' | |
| ] | |
| ) | |
| .pipe( concat('app.js') ) | |
| .pipe( gulp.dest('public/assets/js') ) | |
| .pipe(rename('app.min.js')) | |
| .pipe( uglify() ) | |
| .pipe( gulp.dest('public/assets/js') ); | |
| }); | |
| gulp.task('default', function(){ | |
| gulp.run('css-compress', 'js-compress'); | |
| gulp.watch('assets/stylesheets/**/*.css', function(){ | |
| gulp.run('css-compress'); | |
| }); | |
| gulp.watch('assets/javascripts/**/*.js', function(){ | |
| gulp.run('js-compress'); | |
| }); | |
| }); |
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
| { | |
| "devDependencies": { | |
| "gulp": "~3.5.0", | |
| "gulp-minify-css": "~0.2.0", | |
| "gulp-uglify": "~0.2.0", | |
| "gulp-concat": "~2.1.7", | |
| "gulp-rename": "~0.2.2" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment