I am trying to do the following:
- Combine all CSS files (jQuery plugins)
- Combine media queries
- Collapse CSS
- Create source map
after that i try to do something else in another folder
- Translate LESS
- Combine media queries
- Collapse the resulting CSS
- Create source map
- Autodetect file
It looks like this:
gulp.task('styles', function() { var streamCSS = gulp.src(sources.css) .pipe(sourcemaps.init()) .pipe(concat('vendor.css')) .pipe(cmq()) .pipe(minify({ keepSpecialComments: '*' })) .pipe(sourcemaps.write()); var streamLESS = gulp.src(sources.less) .pipe(plumber({ errorHandler: errorHandler })) .pipe(sourcemaps.init()) .pipe(less()) .on('error', swallowError) .pipe(cmq()) .pipe(minify({ keepSpecialComments: '*' })) .pipe(sourcemaps.write()) .pipe(prefix("last 2 versions", "> 1%", "ios >= 6", { map: true })) .on('error', swallowError); return es.merge(streamCSS, streamLESS) .pipe(plumber({ errorHandler: errorHandler })) .pipe(concat('main.css')) .pipe(gulp.dest(destinations.css)) .pipe(connect.reload()); });
The only problem I am facing is that the resulting source map is incorrect and always refers to the wrong LESS file.
For this, I use the following libraries:
- gulp -concat
- gulp - Less
- gulp -autoprefixer
- gulp combine harvester media queries
- gulp -sourcemaps
- gulp -minify-CSS
I know that this will work if I refuse the supplier material, but I would like to have only one resulting stylesheet.
Thanks for every tip!
lumio source share