Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Use sassOptions from gulp config #115

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions gulp-tasks/gulp-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const cached = require('gulp-cached');
const flatten = require('gulp-flatten');
const gulpif = require('gulp-if');
const cleanCSS = require('gulp-clean-css');
const _ = require('lodash');

((() => {
module.exports = (gulp, { cssConfig, debug }, { watch, validate }, browserSync) => {
module.exports = (gulp, { cssConfig, debug, sassOptions }, { watch, validate }, browserSync) => {
function cssCompile(done) {
gulp.src(cssConfig.src)
.pipe(sassGlob())
Expand All @@ -21,12 +22,12 @@ const cleanCSS = require('gulp-clean-css');
}],
}))
.pipe(sourcemaps.init({ debug }))
.pipe(sass({
.pipe(sass(_.defaultsDeep({
outputStyle: cssConfig.outputStyle,
sourceComments: cssConfig.sourceComments,
// eslint-disable-next-line global-require
includePaths: require('node-normalize-scss').with(cssConfig.includePaths),
}).on('error', sass.logError))
}, sassOptions || {})).on('error', sass.logError))
.pipe(prefix(cssConfig.autoPrefixerBrowsers))
.pipe(sourcemaps.init())
.pipe(gulpif(cssConfig.cleanCSS.enabled === true, cleanCSS({
Expand Down