admin管理员组文章数量:1328029
I am trying to get gulp to pile my sass
and use the susy
grid/framework.
I'm having troubles finding any information about this online.
I have included:
"gulp-ruby-sass": "^0.7.1",
into my package.json
and installed everything.
My gulp sass
gulp task likes like so:
gulp.task('sass', ['images'], function () {
return gulp.src('src/sass/*.{sass, scss}')
.pipe(sass({
bundleExec: true,
sourcemap: true,
sourcemapPath: '../sass'
}))
.on('error', handleErrors)
.pipe(gulp.dest('build'));
});
So I can't for the life of me work out how to include susy
so it plies using gulp
, I haven't looked and can't seem to find anything relating to this online.
I am trying to get gulp to pile my sass
and use the susy
grid/framework.
I'm having troubles finding any information about this online.
I have included:
"gulp-ruby-sass": "^0.7.1",
into my package.json
and installed everything.
My gulp sass
gulp task likes like so:
gulp.task('sass', ['images'], function () {
return gulp.src('src/sass/*.{sass, scss}')
.pipe(sass({
bundleExec: true,
sourcemap: true,
sourcemapPath: '../sass'
}))
.on('error', handleErrors)
.pipe(gulp.dest('build'));
});
So I can't for the life of me work out how to include susy
so it plies using gulp
, I haven't looked and can't seem to find anything relating to this online.
2 Answers
Reset to default 5You can use gulp-pass
, you only need to have pass installed in your system and install gulp-pass
package through npm, here is a sample code:
var pass = require('gulp-pass');
gulp.task('pass', function() {
return gulp.src('./src/*.scss')
.pipe(pass({
// Gulp-pass options and paths
css: 'app/assets/css',
sass: 'app/assets/sass',
require: ['susy']
}))
.on('error', handleErrors)
.pipe(gulp.dest('app/assets/temp'));
});
More info about this package here
To have more details from Jamie's answer, here is what you can do to use susy without pass..
- download .zip package of susy from github. extract package into node_modules directory.
- In my case I put it in susy-master folder.
In gulpfile.js, you could have some thing like this to include susy package. Note that the important is to put correct includePath value to be the same path of the susy-master folder..
gulp.task('sass', function(){ gulp.src('public/sass/styles.scss') .pipe(sourcemaps.init()) .pipe(sass({ outputStyle: 'pressed', includePaths: ['node_modules/susy-master/sass'] }).on('error', sass.logError)) .pipe(sourcemaps.write('maps')) .pipe(gulp.dest('public/css')) });
Import susy in styles.scss
@import "susy";
本文标签: javascriptCompiling SASS and SUSY with GULPStack Overflow
版权声明:本文标题:javascript - Compiling SASS and SUSY with GULP - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742238255a2438471.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论