Last active
August 29, 2015 14:08
-
-
Save bigglesrocks/e3b3f4d199a48a933d4e to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
clear | |
echo "Installing Node" | |
# echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
# . ~/.bashrc | |
# mkdir ~/local | |
# mkdir ~/node-latest-install | |
# cd ~/node-latest-install | |
# curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
# ./configure --prefix=~/local | |
# make install # ok, fine, this step probably takes more than 30 seconds... | |
# curl https://www.npmjs.org/install.sh | sh | |
echo "Installing Gulp" | |
npm install -save-dev gulp | |
echo "Installing Gulp dependencies" | |
npm install -save-dev gulp-sass | |
echo "SASS (gulp-sass)" | |
npm install -save-dev gulp-bless | |
echo "Bless (gulp-bless)" | |
npm install -save-dev gulp-autoprefixer | |
echo "Auto-prefixer (gulp-autoprefixer)" | |
npm install -save-dev gulp-concat | |
echo "Concatentation (gulp-concat)" | |
npm install -save-dev gulp-jshint | |
echo "jsHint (gulp-jshint)" | |
npm install -save-dev gulp-uglify | |
echo "Uglify.js(gulp-uglify)" | |
npm install -save-dev gulp-kit | |
echo "Codekit .kit (gulp-kit)" | |
npm install -save-dev gulp-rename | |
echo "File Renaming (gulp-rename)" | |
npm install -save-dev gulp-imagemin | |
echo "Imagemin (gulp-imagemin)" | |
npm install -save-dev gulp-livereload | |
echo "Live Reload (gulp-livereload)" | |
echo "Successfully installed" | |
echo "run gulp watch to watch for file changes" |
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'), | |
jshint = require('gulp-jshint'), | |
uglify = require('gulp-uglify'), | |
concat = require('gulp-concat'), | |
sass = require('gulp-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
bless = require('gulp-bless'), | |
kit = require('gulp-kit'), | |
// imagemin = require('gulp-imagemin'), | |
// pngcrush = require('imagemin-pngcrush'), | |
rename = require('gulp-rename'), | |
livereload = require('gulp-livereload'); | |
gulp.task('js', function () { | |
return gulp.src('*/js/*.js') | |
.pipe(jshint()) | |
.pipe(jshint.reporter('default')) | |
.pipe(uglify()) | |
// .pipe(concat('app.js')) | |
.pipe(gulp.dest('min')) | |
.pipe(livereload()); | |
}); | |
gulp.task('css', function() { | |
return gulp.src('scss/styles.scss') | |
//1. Auto-prefix files | |
.pipe(autoprefixer({ | |
browsers: ['last 2 versions'], | |
cascade: false | |
})) | |
.pipe(sass()) //2. Compile to CSS | |
.pipe(bless()) //3. Bless CSS | |
.pipe(gulp.dest('./css')) | |
.pipe(livereload()); | |
}); | |
gulp.task('html', function() { | |
//1. Compile kit files | |
return gulp.src('pages/*.kit') | |
.pipe(kit()) | |
.pipe(rename(function (path) { | |
path.basename = path.basename.replace("/^_/", ""); | |
})) | |
.pipe(gulp.dest("./pages")) | |
.pipe(livereload()); | |
}); | |
// gulp.task('img', function() { | |
// return gulp.src('src/images/*') | |
// // Compress Images | |
// .pipe(imagemin({ | |
// progressive: true, | |
// svgoPlugins: [{removeViewBox: false}], | |
// use: [pngcrush()] | |
// })) | |
// .pipe(gulp.dest('dist')) | |
// .pipe(livereload()); | |
// }); | |
// gulp.task('build', ['html', 'css', 'js', 'img'], function() { | |
// livereload(); | |
// }); | |
gulp.task('watch', function() { | |
gulp.task('watch', function() { | |
gulp.watch(['js/*.js'], ['js']); | |
gulp.watch(['scss/*.scss'], ['css']); | |
gulp.watch(['pages/*.kit'], ['html']); | |
// gulp.watch(['img/*.png', 'img/*.jpg', 'img/*.jpeg', 'img/*.gif'], ['img']); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment