Answer the question
In order to leave comments, you need to log in
Why doesn't @import work (gives an error) in gulp-stylus?
Doesn't work either via stylus API:
gulp.task('build:style', function (done) {
gulp.src(path.app.style)
//some pipe
.pipe(stylus({
import: ['app/blocks/common/mixins.styl'],
compress: true,
'include css': true
}))
//some pipe
.pipe(gulp.dest(path.build.style))
done();
});
Answer the question
In order to leave comments, you need to log in
So far I've found this workaround.
We collect all the files and do the concatenation.
The connection order in scr is important.
Because if you do not specify mixins ahead, then they may not be available.
gulp.src(['app/blocks/common/mixins.styl', 'app/blocks/**/*.styl'])
.pipe(sourcemap.init())
.pipe(concat('app.styl'))
.pipe(stylus({
compress: true,
'include css': true
}))
//some pipe
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question