Answer the question
In order to leave comments, you need to log in
Gulp not compiling scss code to dist folder in VSCode?
Please tell me what is wrong, why does the terminal give an error?
1. There is a package.json file:
{
"name": "gulp-scss-init",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "npx gulp watch"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"gulp": "^4.0.2",
"gulp-autoprefixer": "^8.0.0",
"gulp-sass": "^5.0.0",
"node-sass": "^6.0.1"
}
}
const { task, src, watch, dest } = require('gulp');
const autoprefixer = require('gulp-autoprefixer');
const sass = require('gulp-sass');
sass.compiler = require('node-sass');
function scss() {
return src('src/scss/**/*.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(autoprefixer())
.pipe(dest('dist/css'))
}
task('watch', () => {
watch('src/scss/**/*.scss', scss);
});
TypeError: sass.sync is not a function
at scss (C:\Users\yuriy\Desktop\EASY CODE\WEEK7\Учебная\Gulp-Scss-Init\gulpfile.js:9:20)
at bound (domain.js:416:15)
at runBound (domain.js:427:12)
at asyncRunner (C:\Users\yuriy\Desktop\EASY CODE\WEEK7\Учебная\Gulp-Scss-Init\node_modules\async-done\index.js:55:18)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question