comparison gulpfile.js @ 807:4d0f80b2ba7f

cm: Fix `gulpfile` for FoodTruck.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 17 Dec 2016 19:49:52 -0800
parents c1a94e1beb9d
children dff873f11541
comparison
equal deleted inserted replaced
806:8ac2d6045d1d 807:4d0f80b2ba7f
9 concat = require('gulp-concat'), 9 concat = require('gulp-concat'),
10 uglify = require('gulp-uglify'); 10 uglify = require('gulp-uglify');
11 11
12 // Stylesheets 12 // Stylesheets
13 gulp.task('sass', function() { 13 gulp.task('sass', function() {
14 return gulp.src('foodtruck/assets/sass/**/*.scss') 14 return gulp.src('piecrust/admin/assets/sass/**/*.scss')
15 //.pipe(sourcemaps.init()) 15 //.pipe(sourcemaps.init())
16 .pipe(sass({ 16 .pipe(sass({
17 errLogToConsole: true, 17 errLogToConsole: true,
18 outputStyle: 'compressed', 18 outputStyle: 'compressed',
19 includePaths: [ 19 includePaths: [
20 'bower_components/bootstrap-sass/assets/stylesheets', 20 'bower_components/bootstrap-sass/assets/stylesheets',
21 'bower_components/Ionicons/scss']})) 21 'bower_components/Ionicons/scss']}))
22 .pipe(cssnano()) 22 .pipe(cssnano())
23 //.pipe(sourcemaps.write()) 23 //.pipe(sourcemaps.write())
24 .pipe(rename({suffix: '.min'})) 24 .pipe(rename({suffix: '.min'}))
25 .pipe(gulp.dest('foodtruck/static/css')); 25 .pipe(gulp.dest('piecrust/admin/static/css'));
26 }); 26 });
27 gulp.task('sass:watch', function() { 27 gulp.task('sass:watch', function() {
28 return gulp.watch('foodtruck/assets/sass/**/*.scss', ['sass']); 28 return gulp.watch('piecrust/admin/assets/sass/**/*.scss', ['sass']);
29 }); 29 });
30 30
31 // Javascript 31 // Javascript
32 gulp.task('js', function() { 32 gulp.task('js', function() {
33 return gulp.src([ 33 return gulp.src([
38 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js', 38 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js',
39 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/modal.js', 39 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/modal.js',
40 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js', 40 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js',
41 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/transition.js', 41 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/transition.js',
42 'bower_components/jquery-timeago/jquery.timeago.js', 42 'bower_components/jquery-timeago/jquery.timeago.js',
43 'foodtruck/assets/js/**/*.js' 43 'piecrust/admin/assets/js/**/*.js'
44 ]) 44 ])
45 .pipe(sourcemaps.init()) 45 .pipe(sourcemaps.init())
46 .pipe(concat('foodtruck.js')) 46 .pipe(concat('foodtruck.js'))
47 //.pipe(uglify()) 47 //.pipe(uglify())
48 .pipe(sourcemaps.write()) 48 .pipe(sourcemaps.write())
49 .pipe(rename({suffix: '.min'})) 49 .pipe(rename({suffix: '.min'}))
50 .pipe(gulp.dest('foodtruck/static/js')); 50 .pipe(gulp.dest('piecrust/admin/static/js'));
51 }); 51 });
52 gulp.task('js:watch', function() { 52 gulp.task('js:watch', function() {
53 return gulp.watch('foodtruck/assets/js/**/*.js', ['js']); 53 return gulp.watch('piecrust/admin/assets/js/**/*.js', ['js']);
54 }); 54 });
55 55
56 // Fonts/images 56 // Fonts/images
57 gulp.task('fonts', function() { 57 gulp.task('fonts', function() {
58 return gulp.src([ 58 return gulp.src([
59 'bower_components/bootstrap-sass/assets/fonts/bootstrap/*', 59 'bower_components/bootstrap-sass/assets/fonts/bootstrap/*',
60 'bower_components/Ionicons/fonts/*' 60 'bower_components/Ionicons/fonts/*'
61 ]) 61 ])
62 .pipe(gulp.dest('foodtruck/static/fonts')); 62 .pipe(gulp.dest('piecrust/admin/static/fonts'));
63 }); 63 });
64 64
65 gulp.task('images', function() { 65 gulp.task('images', function() {
66 return gulp.src([ 66 return gulp.src([
67 'bower_components/bootstrap-sass/assets/images/*', 67 'bower_components/bootstrap-sass/assets/images/*',
68 'foodtruck/assets/img/*' 68 'piecrust/admin/assets/img/*'
69 ]) 69 ])
70 .pipe(gulp.dest('foodtruck/static/img')); 70 .pipe(gulp.dest('piecrust/admin/static/img'));
71 }); 71 });
72 72
73 // Launch tasks 73 // Launch tasks
74 gulp.task('default', function() { 74 gulp.task('default', function() {
75 gulp.start(['sass', 'js', 'fonts', 'images']); 75 gulp.start(['sass', 'js', 'fonts', 'images']);