T
T
Taras2018-02-27 21:47:05
css
Taras, 2018-02-27 21:47:05

The problem with gulp is more precisely with @import. How to decide?

Good evening. My problem is that every 5 minutes I get an error that something is wrong, for example, @import 'сlients' I don’t write anything in detail, I don’t know how to deal with the problem. And he always hysteria on the last import. I found a way out that I just resaved this file, but it's still not an option. I would like to solve this problem. Here is the skirin:
5a95a6bdb0581742521215.png
Code with galp.js

var gulp 								= require('gulp');
var browserSync 	= require('browser-sync');
var sass        	= require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var concatCSS 			= require('gulp-concat-css');
var ftp						 			= require('gulp-ftp');

// Static Server + watching scss/html files
gulp.task('watch', ['sass'], function() {

    browserSync.init({
        server: "src/"
    });
    // Следим за измениями файлами
    gulp.watch("src/sass/*.sass", ['sass']);
    gulp.watch("src/*.html").on('change', browserSync.reload);
});

// компилируем Sass в Css и обновляем страницу
gulp.task('sass', function() {
    return gulp.src("src/sass/*.sass")
        .pipe(sass().on('error', sass.logError))
        .pipe(autoprefixer({
        			browsers: ['last 2 versions'],
        			cascade: false
        	}))
        .pipe(concatCSS("style.css"))
        .pipe(gulp.dest("src/css")) 
        .pipe(browserSync.stream());
});
gulp.task('ftp', function () {
    return gulp.src('src/**')
        .pipe(ftp({
            host: 'заполнено у меня в файле',
            user: 'заполнено у меня в файле',
            pass: 'заполнено у меня в файле',
            remotePath: 'заполнено у меня в файле'   }))
        .pipe(gutil.noop());
});
gulp.task('default', ['serve']);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BB 8, 2018-02-27
@Vorteri

If you import files with the scss or sass extension, then you need to register them in the import
@import "myfile.sass/scss"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question