Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript help! I cant get sass to minify

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #247261
    rony_b
    Participant

    I have a style.css and a folder called sass which contains a style.scss I followed the steps of gulp for beginners but for some reason whatever I type into the .scss file does not compile into the .css file.

    Here is what I have in my gulpfile.js

    gulp.task(‘sass’, function() {
    gulp.src(‘./sass/style.scss’)
    .pipe(plumber(plumberErrorHandler))
    .pipe(sass())
    .pipe(autoprefixer({
    browsers: [‘last 2 versions’]
    }))
    .pipe(gulp.dest(‘./’))
    .pipe(cssnano())
    .pipe(rename(‘style.min.css’))
    .pipe(gulp.dest(‘./build/css’));
    });

    gulp.task(‘browserSync’, function() {
    var files = [
    ‘./build/css/.css’,
    ‘./build/js/
    .js’,
    ‘./*.php’,
    ‘./**/*.php’,
    ];

    gulp.task(‘watch’, [‘browserSync’, ‘sass’, ‘scripts’], function (){
    gulp.watch(‘./sass/.scss’, [‘sass’]);
    gulp.watch(‘./js/
    .js’, [‘scripts’]);
    });

    The js is minifying into a build folder. But I can’t figure out why the css isn’t as well.

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.