Last active
November 5, 2015 15:02
-
-
Save mberizzo/ef0fd56af60ef8e7a9e9 to your computer and use it in GitHub Desktop.
Gulp, Bower, Bootstrap Sass
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
{ | |
"name": "jym-comunicaciones", | |
"main": "index.js", | |
"version": "0.0.0", | |
"authors": [ | |
"Matias Berizzo" | |
], | |
"description": "JyM Comunicaciones - Ecommerce", | |
"license": "MIT", | |
"ignore": [ | |
"**/.*", | |
"node_modules", | |
"bower_components", | |
"test", | |
"tests" | |
], | |
"dependencies": { | |
"bootstrap-sass-official": "~3.3.1" | |
} | |
} |
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'), | |
sass = require('gulp-sass'), | |
mincss = require('gulp-minify-css'), | |
concat = require('gulp-concat'), | |
gulpBowerFiles = require('gulp-bower-files'), | |
browserSync = require('browser-sync'), | |
reload = browserSync.reload; | |
publicDir = './public/', | |
bootstrapDir = './bower_components/bootstrap-sass-official/assets/stylesheets/'; | |
/** | |
* Project sass | |
*/ | |
gulp.task('sass', function(){ | |
gulp.src(publicDir + 'scss/_style.scss') | |
.pipe(concat('style.css')) | |
.pipe(sass()) | |
.pipe(gulp.dest(publicDir + 'css/')); | |
}); | |
/** | |
* Bootstrap sass | |
*/ | |
gulp.task('bootstrap-sass', function(){ | |
gulp.src(bootstrapDir + '_bootstrap.scss') | |
.pipe(concat('bootstrap.css')) | |
.pipe(sass()) | |
.pipe(gulp.dest(publicDir + 'css/')); | |
}); | |
/** | |
* Concat and minify | |
*/ | |
gulp.task('concat-min', function(){ | |
gulp.src([publicDir + 'css/bootstrap.css', publicDir + 'css/style.css']) | |
.pipe(concat('style.min.css')) | |
.pipe(mincss()) | |
.pipe(gulp.dest(publicDir + 'css/')); | |
}); | |
/** | |
* Init Browser Sync | |
*/ | |
gulp.task('browser-sync', function() { | |
browserSync({ | |
proxy: 'leader.dev' | |
}); | |
}); | |
/** | |
* Reload browser when view is modified | |
*/ | |
gulp.task('reload', function() { | |
gulp.src([publicDir + 'css/*.css', publicDir + '*.html']) | |
.pipe(reload({stream:true})); | |
}); | |
/** | |
* Bower files | |
*/ | |
gulp.task('bower-files', function(){ | |
gulpBowerFiles().pipe(gulp.dest(publicDir + 'lib')); | |
}); | |
/** | |
* Watch | |
*/ | |
gulp.task('watch', function(){ | |
gulp.watch([publicDir + 'scss/**/*.scss'], ['sass']); | |
gulp.watch([bootstrapDir + '*.scss', bootstrapDir + 'bootstrap/*.scss', bootstrapDir + 'bootstrap/mixins/*.scss'], ['bootstrap-sass']); | |
gulp.watch([publicDir + 'css/bootstrap.css', publicDir + 'css/style.css'], ['concat-min']); | |
gulp.watch([publicDir + 'css/*.css', publicDir + 'javascript/*.js', publicDir + '*.html'], ['reload']); | |
}); | |
/** | |
* RUN FOREST! | |
*/ | |
gulp.task('default', ['watch', 'browser-sync']); |
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
{ | |
"name": "leader", | |
"version": "0.0.0", | |
"description": "Leadership", | |
"main": "index.js", | |
"dependencies": {}, | |
"devDependencies": { | |
"browser-sync": "^2.4.0", | |
"gulp": "^3.8.10", | |
"gulp-bower-files": "^0.2.7", | |
"gulp-concat": "^2.4.2", | |
"gulp-minify-css": "^0.3.11", | |
"gulp-sass": "^1.2.4" | |
}, | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Matias Berizzo", | |
"license": "ISC" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment