Good afternoon, I have a folder with files folder "file"
It contains a.styl, b.styl, c.styl files. There is a f.styl file.
Its content is:

@import "file/a" @import "file/b" @import "file/c" 

Question: How to program gulpfile.js so that it mines every file a, b, c into a.css b.css c.css

    1 answer 1

     'use strict'; var gulp = require('gulp'), watch = require('gulp-watch'), prefixer = require('gulp-autoprefixer'), cssmin = require('gulp-cssmin'), styl = require('gulp-stylus'), plumber = require('gulp-plumber'), rename = require('gulp-rename'), sourcemaps = require('gulp-sourcemaps'), notify = require('gulp-notify'); var path = { build: { css: 'build/css/' }, src: { style: 'src/style/*.styl' }, watch: { style: 'src/style/*.styl' }, clean: './build' }; gulp.task('style:build', function () { gulp.src(path.src.style) .pipe(plumber({errorHandler: notify.onError("Error: <%= error.message %>")})) .pipe(sourcemaps.init()) .pipe(styl({'include css': true})) .pipe(prefixer()) .pipe(cssmin()) .pipe(sourcemaps.write()) .pipe(rename({ suffix: '.min' })) .pipe(gulp.dest(path.build.css)); }); gulp.task('build', [ 'style:build' ]); gulp.task('watch', function(){ watch([path.watch.style], function(event, cb) { gulp.start('style:build'); }); }); gulp.task('default', ['build', 'watch']);