Gulp-sass fails to compile scss file

前端 未结 3 846
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-05 17:57

I\'m using Gulp to compile my sass into css. A simple task compiles the style.scss file in the _/sass directory and saves the output into the root of t

相关标签:
3条回答
  • 2021-02-05 18:13

    Keep your imports as is, just pass the includePaths option in your gulp sass module as an argument:

    gulp.src('./_/sass/style.scss')
            .pipe(sass({ includePaths : ['_/sass/'] }))
            .pipe(gulp.dest('./'));
    

    ...should do it for you.

    As per https://github.com/dlmanning/gulp-sass/issues/1

    0 讨论(0)
  • 2021-02-05 18:18

    For this you need to do start with same gulpfile.js folder

    @import '_/sass/reset'
    

    I think the Gulp reads the import and find the file from where gulpfile.js are located

    0 讨论(0)
  • 2021-02-05 18:27

    If you use Sublime text with Windows, you should add rules in Sunlime config. Just add "atomic_save" : true in Preferences>Settings-User

    https://github.com/dlmanning/gulp-sass/wiki/Common-Issues-and-Their-Fixes#partials-sporadically-not-found

    0 讨论(0)
提交回复
热议问题