N
N
Nikita Kit2017-03-16 18:29:21
JavaScript
Nikita Kit, 2017-03-16 18:29:21

How to compile all module styles in main.css without adding imports?

Hello.
I decided to personalize the yeo generator yeogurt a little for my tasks. Successfully added coffeescript to the tasks, updated jade to pug, it remains only to figure out how to import styles in main.css. Here I got a snag and I can’t figure out which dest should be specified in the sass task so that the compiler looks for all the styles in src/modules and src/styles and compiles them into one tmp/main.css.
Here are the pipes related to source and compilation paths

gulp.task('sass', function() {
    gulp.src([path.join(dirs.source, dirs.styles, '**/*.{sass,scss}'),
              path.join(dirs.source, dirs.modules, '**/*.{sass,scss}')])
      .pipe(plugins.sass({
        outputStyle: 'expanded',
        precision: 10,
        includePaths: [
          path.join(dirs.source, dirs.styles,'**/*.{sass,scss}'),
          path.join(dirs.source, dirs.modules,'**/*.{sass,scss}')
        ]
      }))
      .pipe(gulp.dest(dest))
  });

dest contains 'tmp/styles'. If I impudently specify tmp/styles/main.css in dest - gulp starts trolling me and creates the main.css folder, compiling all files with styles in analogy with the folder structure that it finds in src/modules.
Googling didn't work out anything. I don't even know how to make a request.
Guys, help me out. Writing imports by hand just zae me *

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alvvi, 2017-03-16
@alvvi

If you want the output to be a single file, the style files in the stream must be concatenated using, for example, gulp-cnocat.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question