Code Monkey home page Code Monkey logo

gulp-better-sass-inheritance's People

Contributors

jeff2ma avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

fent zhouytao

gulp-better-sass-inheritance's Issues

compiles empty css files

when compiling scss files it returns empty files.

Files.zip

gulpfile.js:

'use strict';
var gulp = require('gulp');
var sassInheritance = require('gulp-better-sass-inheritance');
var sass = require('gulp-sass');
var cached = require('gulp-cached');
var gulpif = require('gulp-if');
var filter = require('gulp-filter');

const styleChanged = () => {
  return gulp.src("./STYLE/**/*.scss")
    .pipe(gulpif(global.isWatching, cached("sass")))
    .pipe(sassInheritance({base: "./STYLE/"}))
    .pipe(filter(function (file) {
      return !/\/_/.test(file.path) || !/^_/.test(file.relative);
    }))
    .pipe(sass())
    .pipe(gulp.dest("./_Build/STYLE"));
};

const doWatch = () => {
	global.isWatching = true;
	gulp.watch("./STYLE/**/*.scss", styleChanged);
};

exports.default = doWatch;
exports.styleChanged = styleChanged;

配合 gulp-sass-glob 使用时出现报错

您好 :)

十分感谢您写的文章 以及贡献了如此实用的 gulp 插件,帮助我在工作中节省大量的时间。

不过,再一次尝试使用 gulp-sass-glob 的过程中,使用 @import 'base/**/*';这样的语法时遇到了错误:

Error: File to import not found or unreadable: base/**/*.
       Parent style sheet: /path_to/project/src/styles/app.scss
        on line 7 of scss/app.scss
>> @import 'base/**/*';

这是我的 gulp 配置文件:

var gulp = require('gulp');
var sassInheritance = require('gulp-better-sass-inheritance');
var sass = require('gulp-sass');
var cached = require('gulp-cached');
var sassGlob = require('gulp-sass-glob');

gulp.task('sass', function(done) {
  return gulp.src("src/styles/*")
    .pipe(cached('sass'))
    .pipe(sassGlob())
    .pipe(sassInheritance({base: 'src/styles/'}))
    .pipe(sass())
    .pipe(gulp.dest("src/styles/*"))
});

不知您是否遇到过类似的问题与对应的解决方案么?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.