Mercurial > piecrust2
comparison gulpfile.js @ 603:7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 27 Jan 2016 20:04:52 -0800 |
parents | |
children | cb92d6eca543 |
comparison
equal
deleted
inserted
replaced
602:c6bc0ef03f82 | 603:7e4e567377cd |
---|---|
1 'use strict'; | |
2 | |
3 var gulp = require('gulp'), | |
4 util = require('gulp-util'), | |
5 sass = require('gulp-sass'), | |
6 sourcemaps = require('gulp-sourcemaps'), | |
7 rename = require('gulp-rename'), | |
8 minify = require('gulp-minify-css'), | |
9 concat = require('gulp-concat'), | |
10 uglify = require('gulp-uglify'); | |
11 | |
12 // Stylesheets | |
13 gulp.task('sass', function() { | |
14 return gulp.src('foodtruckui/assets/sass/**/*.scss') | |
15 //.pipe(sourcemaps.init()) | |
16 .pipe(sass({ | |
17 errLogToConsole: true, | |
18 outputStyle: 'compressed', | |
19 includePaths: [ | |
20 'bower_components/bootstrap-sass/assets/stylesheets', | |
21 'bower_components/Ionicons/scss']})) | |
22 //.pipe(sourcemaps.write()) | |
23 .pipe(rename({suffix: '.min'})) | |
24 .pipe(minify()) | |
25 .pipe(gulp.dest('../foodtruck/static/css')); | |
26 }); | |
27 gulp.task('sass:watch', function() { | |
28 return gulp.watch('foodtruckui/assets/sass/**/*.scss', ['sass']); | |
29 }); | |
30 | |
31 // Javascript | |
32 gulp.task('js', function() { | |
33 return gulp.src([ | |
34 'bower_components/jquery/dist/jquery.js', | |
35 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/alert.js', | |
36 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/button.js', | |
37 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/collapse.js', | |
38 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js', | |
39 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js', | |
40 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/transition.js', | |
41 'foodtruckui/assets/js/**/*.js' | |
42 ]) | |
43 .pipe(sourcemaps.init()) | |
44 .pipe(concat('foodtruck.js')) | |
45 .pipe(sourcemaps.write()) | |
46 .pipe(rename({suffix: '.min'})) | |
47 //.pipe(uglify()) | |
48 .pipe(gulp.dest('../foodtruck/static/js')); | |
49 }); | |
50 gulp.task('js:watch', function() { | |
51 return gulp.watch('foodtruckui/assets/js/**/*.js', ['js']); | |
52 }); | |
53 | |
54 // Fonts/images | |
55 gulp.task('fonts', function() { | |
56 return gulp.src([ | |
57 'bower_components/bootstrap-sass/assets/fonts/bootstrap/*', | |
58 'bower_components/Ionicons/fonts/*' | |
59 ]) | |
60 .pipe(gulp.dest('../foodtruck/static/fonts')); | |
61 }); | |
62 | |
63 gulp.task('images', function() { | |
64 return gulp.src([ | |
65 'bower_components/bootstrap-sass/assets/images/*', | |
66 'foodtruckui/assets/img/*' | |
67 ]) | |
68 .pipe(gulp.dest('../foodtruck/static/img')); | |
69 }); | |
70 | |
71 // Launch tasks | |
72 gulp.task('default', function() { | |
73 gulp.start(['sass', 'js', 'fonts', 'images']); | |
74 }); | |
75 | |
76 gulp.task('watch', function() { | |
77 gulp.start(['sass:watch', 'js:watch']); | |
78 }); | |
79 | |
80 |