Search code examples
javascriptcssnode.jssassgulp

Gulp doesn't create files


i'm totaly new to node.js and code in general. I tried a simple conversion of SCSS to CSS with gulp , my gulpfile.js seems to be correct, somehow when i try to execute "gulp styles" in the node.js command prompt i get this :

`

C:\Users\33666\Downloads\projet gulp>gulp styles
[14:18:03] Using gulpfile ~\Downloads\projet gulp\gulpfile.js
[14:18:03] Starting 'styles'...
[14:18:03] Finished 'styles' after 9.84 ms

'''

and no file is created in my "build" folder. The "gulpfile.js" i'm using is this one :

'''

var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
 
gulp.task('styles', () =>
    gulp.src('css/*.scss')
        .pipe(sass().on('error', sass.logError))
        .pipe(autoprefixer({
            browsers: ['last 5 versions']
        }))
        .pipe(gulp.dest('build'))
);
gulp.task('watch', () =>
    gulp.watch('css/style.scss', gulp.series('styles'))
);

'''

Thanks.


Solution

  • I solved my problem, my SCSS file was at the root of my folder , i created a CSS folder in which i put it and it solved the issue .