Skip to content

Instantly share code, notes, and snippets.

@edwinlab
Created March 14, 2016 09:15
Show Gist options
  • Save edwinlab/610c8f1c940b25758a21 to your computer and use it in GitHub Desktop.
Save edwinlab/610c8f1c940b25758a21 to your computer and use it in GitHub Desktop.
Simple glupfile.js
var gulp = require('gulp'),
concat = require('gulp-concat'),
prefix = require('gulp-autoprefixer'),
sass = require('gulp-sass')
cleancss = require('gulp-clean-css'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
notify = require('gulp-notify');
var cssDir = 'public/assets/css',
jsDir = 'public/assets/js';
gulp.task('css', function(){
gulp.src(['assets/bootstrap.css', 'assets/style.css'])
.pipe(cleancss())
.pipe(prefix('last 1 version'))
.pipe(concat('styles.min.css'))
.pipe(gulp.dest(cssDir))
.pipe(notify({ message: "Site CSS Processed"}));
});
gulp.task('css', function(){
gulp.src(['assets/jquery.min.js', 'assets/script.js'])
.pipe(uglify({mangle: false}))
.pipe(prefix('last 1 version'))
.pipe(concat('script.min.js'))
.pipe(gulp.dest(jsDir))
.pipe(notify({ message: "Site Js Processed"}));
});
gulp.task('default', function(){
gulp.run('css', 'js');
gulp.watch("assets/*.css", function(event){
gulp.run('css');
});
gulp.watch("assets/*.js", function(event){
gulp.run('js');
});
});
{
"name": "cinemaxx",
"version": "0.0.1",
"description": "Cinemaxx Frontend",
"author": "@edwinlab",
"devDependencies": {
"gulp": "~3.9.1",
"gulp-concat": "~2.6.0",
"gulp-sass": "~2.2.0",
"gulp-uglify": "~1.5.3",
"gulp-clean-css": "~2.0.3",
"gulp-notify": "~2.2.0",
"gulp-rename": "~1.2.2",
"gulp-autoprefixer": "~3.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment