I am a beginner and have completed my HTML & CSS. For Sass, I am trying to set-up a dev environment and for some reason the gulpfile.js code appears to be OK, but when the task is run (gulp style)
then it doesn't output a CSS file. There are no errors either on the command line.
I have installed gulp, gulp cli, gulp-sass and browser-sync
$npm install gulp -global
$npm install gulp cli
$npm install --save-dev gulp gulp-sass browser-sync
Her's my code:
const gulp = require('gulp');
const sass = require('gulp-sass');
async function style() {
gulp.src('./scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('./css/'));
}
exports.style = style;
The folder structure for the project is as mentioned below:
_
|-- node_modules
|-- src
|-- scss
|-- style.scss
|-- gulpfile.js
|-- index.html
|-- package-lock.json
|-- package.json