Answer the question
In order to leave comments, you need to log in
Gupl. Why such strange behavior (newbie question)?
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
sourcemaps = require('gulp-sourcemaps'),
purge = require('gulp-css-purge'),
browserSync = require('browser-sync');
var scssSrcFiles = ('templates/seb_minima/sass/**/*.scss'),
cssFolderDest = ('templates/seb_minima/css'),
PHPPath = ('/templates/**/*.php'),
reload = browserSync.reload,
supported = ['last 20 versions', '> 1%', 'IE >= 1', 'Firefox >= 1', 'Opera >= 1', 'Android >= 1', 'iOS >= 1', 'Safari >= 1'];
gulp.task('SASS to CSS', function () {
return gulp.src(scssSrcFiles)
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(sass({errLogToConsole: true, outputStyle: 'expanded'}).on('error', sass.logError))
.pipe(purge({
trim: true,
shorten: true,
format: true,
bypass_media_rules: true,
special_convert_rem_font_size: true,
verbose: true,
shorten_border: true
}))
.pipe(autoprefixer({browsers: supported, add: true, cascade: false, grid: true}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(cssFolderDest))
.pipe(reload({stream: true}))
return cache.clearAll();
});
gulp.task('browser-sync', function () {
browserSync({
proxy: {
target: "http://my_site/"
},
browser: ["chrome"],
notify: false,
});
});
gulp.task('watch', function () {
gulp.watch(scssSrcFiles, ['SASS to CSS']);
gulp.watch(PHPPath).on('change', reload);
});
gulp.task('default', ['SASS to CSS', 'browser-sync', 'watch']);
scssSrcFiles = ('templates/seb_minima/sass/**/*.scss'),
cssFolderDest = ('templates/seb_minima/css'),
scssSrcFiles = ('templates/my_tmpl/sass/**/*.scss'),
cssFolderDest = ('templates/my_tmpl/css'),
CSS Parser Error: probably have something funny in your CSS, change it then please try again.
Reason: property missing ':'
Line: 27
Column: 1
Filename: demo/test1.css
Answer the question
In order to leave comments, you need to log in
By the fact that it does not find the templates/seb_minima/** folder
Change the paths in gulpfile.js
For example, to these
var scssSrcFiles = ('templates/*/sass/**/*.scss'),
cssFolderDest = ('templates/*/css'),
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question