annotate gulpfile.js @ 612:2edaefcb82cd

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