D
D
Dima2018-05-20 17:46:24
css
Dima, 2018-05-20 17:46:24

How to collect all styl-files in 1 css?

The question is simple and frequent, but the answer could not be found here.
There are two adjacent folders with directories that contain styl files. Previously, I wrote each new styl to this file, then I thought about it and simply abandoned all the styl files that would be created in the directories:

@import 'blocks/*'
@import 'helpers/*'

Everything seems to work, however, when making changes to the files, the page does not reload. Probably something needs to be added to the gulpfile, but I would like to just collect all these styl files into one clean css file.
There is some solution with gulp-filter , but I don't want to have a lot of css files or write a task for their subsequent removal :)
Just in case, I'll drop the current change tracking task
gulp.task('serve', ['styl'], function() {
  server.init({
    server: 'src',
    notify: true,
    open: true,
    cors: true,
    ui: false
  });
  gulp.watch('src/blocks/**/*.styl', ['styl']);
  gulp.watch('src/blocks/**/*.pug', ['pug']);
  gulp.watch('src/*.html').on('change', server.reload);
  gulp.watch('src/css/main.css').on('change', server.reload);
  run(
    'pretty'
  );
});

Thanks in advance for your advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
A person from Kazakhstan, 2018-05-20
@LenovoId

https://ru.stackoverflow.com/a/649283/33274

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question