O
O
Olga66802021-07-01 21:55:03
gulp.js
Olga6680, 2021-07-01 21:55:03

How to fix gulp4 Error in plugin "sass" error?

After the update, the console began to give an error:
Error in plugin "sass"
Message:
catalog\view\theme\...\stylesheet\stylesheet.sass
Error: Expected spaces, was tabs.

13 │ font-family: 'Tavolga Free'
│ ^^^^

catalog\view\theme\...\stylesheet\stylesheet.sass 13:1 root stylesheet Never
had this error before. Please tell me where to fix. I didn't find anything on the Internet. Thanks in advance!

Here is the gulpfile.js file

// Include Gulp and all required libraries
const { src, dest, parallel, series, watch } = require('gulp');
const browserSync = require('browser-sync').create();
const concat = require('
const uglify = require('gulp-uglify-es').default;
const sass = require('gulp-sass')(require('sass'));
const autoprefixer = require('gulp-autoprefixer');
const bourbon = require('node-bourbon');
const cleancss = require('gulp-clean-css');
const newer = require('gulp-newer');
const imagemin = require('gulp-imagemin');
const del = require('del');
const svgstore = require('gulp-svgstore');
const rename = require('gulp-rename');

function browsersync() {
browserSync.init({
proxy: '...loc/',
notify: false,
online:

'node_modules/jquery/dist/jquery.min.js',
'catalog/view/theme/.../js/**/*.js',
])
.pipe(concat('theme.min.js') )
.pipe(uglify())
.pipe(dest('catalog/view/theme/.../js/'))
.pipe(browserSync.stream())
}

function styles() {
return src('catalog/ view/theme/.../stylesheet/stylesheet.sass')
.pipe(sass({
includePaths: bourbon.includePaths
}).on('error', sass.logError))
.pipe(concat('stylesheet.css' ))
.pipe(autoprefixer({ overrideBrowserslist: ['last 25 versions'], grid: true }))
.pipe(cleancss(( { level: { 1: { specialComments: 0 } }, /*format: 'beautify' */ } )))
.pipe(dest('catalog/view/theme/.../stylesheet/'))
.pipe(browserSync.stream())
}

function images() {
return src('image/catalog/**/*')
.pipe(newer('image/cashe/catalog/'))
.pipe(imagemin() )
.pipe(dest('image/cashe/catalog/'))
}

function cleanimg() {
return del('image/cashe/catalog/**/*', { force: true })
}

function cleandist() {
return del('dist/**/*', { force: true })
}

function sprite() {
return src('image/icon-*.svg')
.pipe(svgstore({
inlineSvg: true
}))
. pipe(rename('sprite.svg'))
.pipe(dest('image'));
}

function buildcopy() {
return src([
'catalog/view/theme/.../js/**/*min.js',
'catalog/view/theme/.../stylesheet/**/*.min.css',
'image/cache/ catalog/**/*',
'catalog/view/theme/.../template/**/*.twig'
], { base: './' })
.pipe(dest('dist'));
}

function startwatch() {
watch('catalog/view/theme/.../stylesheet/stylesheet.sass', styles);
watch(['catalog/view/theme/.../js/**/*.js', '!catalog/view/theme/.../js/**/*.min.js'], scripts );
watch('catalog/view/theme/.../template/**/*.twig').on('change', browserSync.reload);
watch('catalog/view/theme/.../libs/**/*').on('change', browserSync.reload);
watch('image/catalog/**/*', images);

exports.scripts = scripts;
exports.styles = styles;
exports.images = images;
exports.cleanimg = cleanimg;
exports.sprite = sprite;
exports.build = series(cleandist, styles, scripts, images, buildcopy);

exports.default = parallel(scripts, styles, browsersync, startwatch);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Olga6680, 2021-07-02
@Olga6680

Thank you! Found the answer. If anyone has the same problems: here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question