gulp plugin for converting Object to scss/sass variable String and output file.
$ npm install gulp-obj-sass-file
var objSassFile = require('gulp-obj-sass-file'),
gulp = require('gulp'),
sass = require('gulp-sass');
gulp.task('conf-to-sass', function() {
return gulp
.src([
'data/config.js',
'data/config.json',
'data/config.coffee' // if you use coffee-script
])
.pipe(objSassFile({
output: {
path: 'css/variable.scss'
}
}))
.pipe(gulp.dest('./'));
});
almost same options with obj-sass
.
but output
added.
see obj-sass.
Type: Object
Default: {}
used for File
of gulp-util
options
Type: String
Default: process.cwd()
the current working directory.
Type: String
Default: output.cwd
used for relative pathing. typically where a glob starts.
Type: String
Default: undefined
full path to the file.