1

I have a single app.scss file which imports ~100 other Scss files. This is then compiled to app.css with a gulp task. app.css contains more than 4095 selectors, so I use gulp-bless to split it up into multiple files.

This all works with the exception of the sourcemaps.

The GitHub page for gulp-bless states that "this can be used with gulp-sourcemaps", but it gives absolutely no documentation or additional details.

The following ends up freezing the entire process:

gulp.src('/path/to/app.scss'))
    .pipe(sourcemaps.init())
    .pipe(sass({
        style: 'expanded'
    }))
    .pipe(autoprefixer())
    .pipe(sourcemaps.write())
    .pipe(bless({
        imports: false
    }))
    .pipe(gulp.dest('/path/to/compiled-css'))

Placing bless before the sourcemaps.write(), removes the sourcemaps entirely from the resulting files.

Has anyone successfully used source maps with gulp-bless, as it is allegedly possible?

Mike
  • 4,071
  • 21
  • 36
  • Can you tell me why do you use `sourcemap`? Is your code the same if your remove sourcemap functions? – smartmouse Jul 15 '16 at 07:35
  • @smartmouse the code stays is the same -- sourcemaps assist in development. A common way to develop larger projects is to have many style files, which get compiled down to one. If you look at an element's CSS properties in some development tools in the browser, it would give the origin of all styles as that single file. With the souremaps, the browser understands where a style came from originally, and therefore makes it easier to use and maintain the CSS. – Mike Jul 15 '16 at 15:28

0 Answers0