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.
我解决了我的问题,我的 SCSS 文件位于我文件夹的根目录,我创建了一个 CSS 文件夹,我把它放在里面,它解决了这个问题。
这里的“项目”这个词有一个错字:
C:\\Users\\33666\\Downloads\\projet gulp>gulp styles
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.