Answer the question
In order to leave comments, you need to log in
Where is the gulp project build error (sass issue)?
Good afternoon!
The project structure is as follows:
Root:
The app folder where everything should compile:
And gulpfile.js with comments:
var gulp = require('gulp'),
sass = require('gulp-sass'),// подключение sass
rename = require('gulp-rename'),//переименовываем миниф файл
cleanCSS = require('gulp-clean-css'),//минифицируем
autoprefixer = require('gulp-autoprefixer'),//автопрефикер
livereload = require('gulp-livereload'),//livereload
connect = require('gulp-connect');//соед с уд сервером
//livereload
gulp.task('connect', function() {
connect.server({
root: 'app',
livereload: true
});
});
gulp.task('css', function () {
return gulp.src('app/sass/main.sass')//путь к папке с sass-файлом, с которым будем работать
.pipe(autoprefixer({
browsers: ['last 15 versions']
}))
.pipe(sass())//sass
.pipe(cleanCSS()) //минифицируем css
.pipe(rename('bundle.min.css'))//как назовем скомпилированный min- файл
.pipe(connect.reload())
.pipe(gulp.dest('app/css'));//куда выкладываем итоговый файл
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question