Skip to content

Instantly share code, notes, and snippets.

@xtepwxly
Created September 19, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xtepwxly/b1c4ccd9ea32deab7066 to your computer and use it in GitHub Desktop.
Save xtepwxly/b1c4ccd9ea32deab7066 to your computer and use it in GitHub Desktop.
gulpfile.js
var gulp = require('gulp'),
sass = require('gulp-sass'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat');
var bowerPath = 'private/bower_components/';
gulp.task('default', ['js-minify', 'js-minify:watch', 'sass', 'sass:watch', 'css']);
gulp.task('js', function() {
gulp.src([
bowerPath + 'angular/angular.min.js',
bowerPath + 'bootstrap/dist/js/bootstrap.min.js',
bowerPath + 'jquery/dist/jquery.min.js'
])
.pipe(gulp.dest('public/js'));
});
gulp.task('js-minify', function() {
gulp.src('private/scripts/*.js')
.pipe(concat('scripts.min.js'))
.pipe(uglify())
.pipe(gulp.dest('public/js'));
});
gulp.task('js-minify:watch', function() {
gulp.watch('private/scripts/scripts.js', ['js-minify']);
});
gulp.task('css', function() {
gulp.src([
bowerPath + 'bootstrap/dist/css/bootstrap.min.css'
])
.pipe(gulp.dest('public/css'));
});
gulp.task('sass', function() {
gulp.src('private/scss/*.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.dest('public/css'));
});
gulp.task('sass:watch', function() {
gulp.watch('private/scss/*.scss', ['sass']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment