Answer the question
In order to leave comments, you need to log in
How to set the path and parameters correctly?
Hello!
Tell me how to solve three problems:
1. I set an auto-prefix, but I don’t understand how it works. When unloading from scss to css, everything remains without prefixes.
For now, you have to use a mixin.
@mixin bShad($box) {
-webkit-box-shadow: $box;
-moz-box-shadow: $box;
box-shadow: $box;
}
var gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat-css'),
autoprefixer = require('gulp-autoprefixer');
gulp.task('sass', function() {
return gulp.src('app/**/**/*.scss')
.pipe(sass())
.pipe(gulp.dest('app/css'))
});
gulp.task('watch', function() {
gulp.watch('app/**/*.scss', ['sass']);
});
gulp.task('default', () =>
gulp.src('src/app.css')
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('dist'))
);
gulp.task('default', function () {
return gulp.src('app/**/**/*.scss')
.pipe(concatCss("main.css"))
.pipe(gulp.dest('app/css/main.css'));
});
Answer the question
In order to leave comments, you need to log in
Everything can be done in one task:
gulp.task('sass', function() {
return gulp.src('app/**/*.scss') // получаем файлы из указанной директории
.pipe(sass()) // компилируем sass в css
.pipe(autoprefixer({ // добавляем вендорные префиксы
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(concat("main.css")) // объединяем файлы в потоке в один с указанным именем
.pipe(gulp.dest('dist')); // выгружаем в папку dist
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question