Created
May 17, 2015 23:34
-
-
Save ancillaryfactory/641ca4557c7e7356e3a9 to your computer and use it in GitHub Desktop.
Basic Gulp Setup
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'), | |
nodemon = require('gulp-nodemon'), | |
sass = require('gulp-sass'), | |
sourcemaps = require('gulp-sourcemaps'), | |
gutil = require('gulp-util'), | |
livereload = require('gulp-livereload'), | |
uglify = require('gulp-uglify'), | |
concat = require('gulp-concat'), | |
ngAnnotate = require('gulp-ng-annotate'), | |
size = require('gulp-size'); | |
gulp.task('sass', function () { | |
gulp.src('./public/sass/style.scss') | |
.pipe(sourcemaps.init()) | |
.pipe(sass({outputStyle: 'compressed'})) | |
.pipe(sourcemaps.write()) | |
.pipe(size()) | |
.pipe(gulp.dest('./public/css')) | |
.pipe(livereload()); | |
}); | |
gulp.task('js:vendor', function(callback) { | |
return gulp.src([ | |
'./public/bower_components/angular/angular.min.js' | |
]) | |
.pipe(sourcemaps.init()) | |
.pipe(concat('vendor.js')) | |
.pipe(uglify()) | |
.pipe(size({showFiles: true})) | |
.pipe(gulp.dest('./public/js/dist')); | |
}); | |
gulp.task('js', function () { | |
gulp.src([ | |
'./public/js/app.js', | |
'./public/js/components/**/*.js', | |
'./public/js/shared/**/*.js', | |
]) | |
.pipe(sourcemaps.init()) | |
.pipe(concat('app.js')) | |
.pipe(ngAnnotate()) | |
//.pipe(uglify()) | |
.pipe(sourcemaps.write('./')) | |
.pipe(size({showFiles: true})) | |
.pipe(gulp.dest('./public/js/dist')); | |
}); | |
gulp.task('watch', function(){ | |
livereload.listen(35727); | |
gulp.watch('./public/sass/**/*.scss', ['sass']); | |
gulp.watch('./public/js/**/*.js', ['js']); | |
nodemon({ | |
ext: 'html js ejs scss' | |
}); | |
}); | |
gulp.task('default', ['sass','js', 'watch']); |
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": "app", | |
"version": "0.1.0", | |
"description": "", | |
"scripts": { | |
"start": "node ./bin/www" | |
}, | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"gulp": "^3.8.11", | |
"gulp-concat": "^2.5.2", | |
"gulp-livereload": "^3.8.0", | |
"gulp-ng-annotate": "^0.5.2", | |
"gulp-nodemon": "^2.0.2", | |
"gulp-sass": "^1.3.3", | |
"gulp-size": "^1.2.1", | |
"gulp-sourcemaps": "^1.5.1", | |
"gulp-uglify": "^1.2.0", | |
"gulp-util": "^3.0.4" | |
}, | |
"dependencies": { | |
"body-parser": "~1.12.0", | |
"compression": "^1.4.3", | |
"cookie-parser": "~1.3.4", | |
"debug": "~2.1.1", | |
"ejs": "~2.3.1", | |
"express": "~4.12.2", | |
"lodash": "^3.6.0", | |
"moment": "^2.10.3", | |
"mongoose": "3.8", | |
"morgan": "~1.5.1", | |
"serve-favicon": "~2.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment