Answer the question
In order to leave comments, you need to log in
Gulp - gulp-stylus + gulp-concat = love?
Good day to all!
There is a small question to which I cannot "give mind". Organized the stylus -> css transformation task:
// STYLUS TASK
gulp.task('stylustask', function() {
return gulp.src('app/stylus/*.styl')
.pipe(plumber())
.pipe(stylus({use:[nib(),jeet(),rupture()]}))
.pipe(prefixer({
browsers: ['last 2 versions']
}))
.pipe(csscomb())
.pipe(notify("Stylus ready!"))
.pipe(gulp.dest('build/css/'));
});
...
link(rel="stylesheet" href="css/font-awesome.css")
link(rel="stylesheet", href="css/owl.carousel.css")
link(rel="stylesheet", href="css/slick.css")
link(rel="stylesheet", href="css/slick-theme.css")
link(rel="stylesheet" href="css/style.css")
link(rel="shortcut icon", type="image/x-icon", href="favicon.ico")
Answer the question
In order to leave comments, you need to log in
Do not fence too complex tasks, it is not easier for the system to perform. than you then support. I advise you to go the way that many have already taken: 1) create a task for transferring styl to css with the output of one file in the build directory 2) create a task with concatenation of all third-party css also in the build directory 3) on the third task, hang the concatenation of all css from the build directory and you already do all the operations with them, minification, auto-prefixes, etc. To ensure that the first two tasks are completed before the third task is completed, the third task can be described as
gulp.task('task3', ['task1', 'task2'], function() {
// Код третьей задачи
});
I use less and that's why I just import css into main.less, sass/stylus can't do that, so there's a good option to build sass/stylus -> css first and then use merge-stream to add a stream with external css (I take it via main-bower-files) and run everything through the concatenation. No temporary files, everything is in memory and easy to maintain. Actually, on projects with ionic, I usually do this.
Just set the option for stylus
'include css': true
And include your css in stylus files with import
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question