Import CSS from node_modules using Gulp-SASS

前端 未结 2 1661
Happy的楠姐
Happy的楠姐 2021-02-08 04:08

I want to import a CSS-file from my node_modules using SASS.

@import \'normalize.css/normalize\';
<         


        
2条回答
  •  时光说笑
    2021-02-08 04:26

    SASS compiler doesn't know where to look for the files. The location needs to be specified.

    gulp.task('sass', function () {
      return gulp.src(['source/assets/css/**.scss', '!source/assets/css/**/_*.[scss|sass'])
        .pipe(sass({
          includePaths: ['node_modules']
        }))
        .pipe(gulp.dest('output/assets/css'));
    });
    

提交回复
热议问题