M
M
Maxim2016-03-18 12:49:07
JavaScript
Maxim, 2016-03-18 12:49:07

Why is node-bourbon not working in gulp with scss?

Can't connect node-bourbon .
Here is my gulpfile.js

var gulp         = require('gulp'),
    sass         = require('gulp-sass'),
    autoprefixer = require('gulp-autoprefixer'),
    minifycss    = require('gulp-minify-css'),
    rename       = require('gulp-rename'),
    browserSync  = require('browser-sync').create(),
    concat       = require('gulp-concat'),
    uglify       = require('gulp-uglifyjs'),
    bourbon      = require('node-bourbon');

gulp.task('browser-sync', ['styles', 'scripts'], function() {
    browserSync.init({
        server: {
            baseDir: "./app"
        },
        notify: false
    });
});

gulp.task('styles', function () {
  return gulp.src('scss/*.scss')
  .pipe(sass().on('error', sass.logError))
  .pipe(rename({suffix: '.min', prefix : ''}))
  .pipe(autoprefixer({browsers: ['last 15 versions'], cascade: false}))
  .pipe(minifycss())
  .pipe(gulp.dest('app/css'))
  .pipe(browserSync.stream());
});

gulp.task('scripts', function() {
  return gulp.src([
    './app/libs/modernizr/modernizr.js',
    './app/libs/jquery/jquery-1.11.2.min.js',
    ])
    .pipe(concat('libs.js'))
    .pipe(uglify())
    .pipe(gulp.dest('./app/js/'));
});

gulp.task('watch', function () {
  gulp.watch('scss/*.scss', ['styles']);
  gulp.watch('app/libs/**/*.js', ['scripts']);
  gulp.watch('app/js/*.js').on("change", browserSync.reload);
  gulp.watch('app/*.html').on('change', browserSync.reload);
});

gulp.task('default', ['browser-sync', 'watch']);

When changing the file and adding Dmitrijs Balcers "burbone"; I get an error
8vsomh2.png
I did everything according to the instructions. What's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
amf1k, 2016-03-18
@amf1k

gulp.task('styles', function () {
  return gulp.src('scss/*.scss')
  .pipe(sass({
        includePaths: bourbone.includePaths
    }).on('error', sass.logError))
  .pipe(rename({suffix: '.min', prefix : ''}))
  .pipe(autoprefixer({browsers: ['last 15 versions'], cascade: false}))
  .pipe(minifycss())
  .pipe(gulp.dest('app/css'))
  .pipe(browserSync.stream());
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question