5

It seems the map file points to the wrong file. Instead of demo.css it points to example.css, for example.

I guess I'm doing something wrong?

This is an example of how my css task is defined for the CSS minification and concatenation:

var gulp = require('gulp');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-clean-css');
var gp_concat = require('gulp-concat');
var size = require('gulp-size');

var path ={
    css: './styles/',
    dist: './dist/'
};

gulp.task('css', function() {
    gulp.src([
            './bower_components/aaa.css',
            path.css + 'demo.css',
            path.css + 'example.css',
            path.css + 'another.css'
        ])
        .pipe(sourcemaps.init())
        .pipe(gp_concat('combined.css'))
        .pipe(gulp.dest(path.dist))
        .pipe(minifyCss({
            compatibility: 'ie8',
            advanced: false,
            keepSpecialComments: '1'
        }))
        .pipe(rename({
            suffix: '.min'
        }))
        .pipe(sourcemaps.write({
            includeContent: false,
            sourceRoot: '../styles'
        }))
        .pipe(gulp.dest(path.dist))
        .pipe(browserSync.reload({
            stream: true
        }))
});
Alvaro
  • 40,778
  • 30
  • 164
  • 336
  • Instead of manually entering your css files such as `path.css + 'demo.css',` you should use the glob selector, `'./styles/**/*.css'` I use this as a reference https://github.com/zellwk/gulp-starter-csstricks/blob/master/gulpfile.js#L33 – M1lls Jun 28 '16 at 19:33
  • 1
    @Mills it doesn't sound right to me if I need to add them in that particular order. But in any case, that won't explain why my references to the full files are wrong. Also, in the link you added they don't use sourcemaps. – Alvaro Jun 29 '16 at 09:03

0 Answers0